Restructure repository to include all source folders

Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 20:17:20 +09:00
parent 5d3cd64a25
commit dd97ddec92
11602 changed files with 1446576 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
Namespace My
' The following events are availble for MyApplication:
'
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Public fileToOpenOnStartup As String = ""
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
AddMath.sharedDataOverWrite(My.Application.Info.DirectoryPath & "\rylCoder_hack.cfg")
Dim s As Collections.ObjectModel.ReadOnlyCollection(Of String) = e.CommandLine
Dim karg As String = ""
For Each arg As String In s
If arg = "-compile" Then 'for disabling karg's
ElseIf arg = "-decompile" Then
ElseIf karg = "-compile" Then
e.Cancel = True
Dim work As New frmWorking
work.Show()
Application.DoEvents()
Dim delete As Boolean = False
Dim fIn As String = arg
Dim fOut As String = arg.Substring(0, arg.Length - 3) & "mcf"
Dim sOut As IO.Stream = IO.File.OpenWrite(fOut)
If (sOut.Length > 0 AndAlso MsgBox("Do you want to overwrite the file '" & vbNewLine & fOut & "' ?", MsgBoxStyle.YesNo, "mcfCoder") = MsgBoxResult.Yes) OrElse sOut.Length < 1 Then
Dim script As New CScriptParser()
Application.DoEvents()
If script.File2struct(fIn) Then
Dim compiler As New CMcfCompiler()
Try
compiler.Compile(script.Functions)
Dim compData As Byte() = CMcfCoder.EnCryptArea(compiler.Data, CMcfCoder.Col.EFirstCol)
sOut.SetLength(0)
sOut.Write(compData, 0, compiler.Data.Length)
sOut.Flush()
Catch ex As Exception
delete = True
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "mcfCoder error")
End Try
Else
delete = True
End If
End If
sOut.Close()
If delete Then
My.Computer.FileSystem.DeleteFile(fOut)
End If
work.Close()
ElseIf karg = "-decompile" Then
e.Cancel = True
Dim work As New frmWorking
work.Show()
Application.DoEvents()
Dim fIn As String = arg
Dim fOut As String = arg.Substring(0, arg.Length - 3) & "mcs"
Dim sIn As IO.Stream = IO.File.OpenRead(fIn)
If (My.Computer.FileSystem.FileExists(fOut) AndAlso MsgBox("Do you want to overwrite the file '" & vbNewLine & fOut & "' ?", MsgBoxStyle.YesNo, "mcfCoder") = MsgBoxResult.Yes) OrElse Not My.Computer.FileSystem.FileExists(fOut) Then
Dim dat(sIn.Length - 1) As Byte
sIn.Read(dat, 0, sIn.Length)
sIn.Close()
Application.DoEvents()
Dim decompiler As New CMcfDecompiler()
Try
dat = CMcfCoder.DeCryptArea(dat, CMcfCoder.Col.EFirstCol)
decompiler.Decompile(dat)
Dim scripter As New CScriptParser
If scripter.Struct2File(decompiler.Functions, fOut) Then
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "mcfCoder error")
End Try
End If
work.Close()
Else
If My.Computer.FileSystem.FileExists(arg) Then
fileToOpenOnStartup = arg
End If
End If
karg = arg
Next
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,55 @@
Imports Microsoft.VisualBasic
Imports System
Imports System.Text
Imports System.CodeDom.Compiler
Imports System.Reflection
Imports System.IO
Public Class CEvalProvider
Public Structure MethodObjectAndInfo
Dim methodObject As Object
End Structure
Friend Shared Function GetFunction(ByVal vbCode As String, Optional ByVal params() As CGsfCoder.SParamElem = Nothing) As System.Reflection.MethodInfo
Dim c As VBCodeProvider = New VBCodeProvider
Dim icc As ICodeCompiler = c.CreateCompiler()
Dim cp As CompilerParameters = New CompilerParameters
cp.ReferencedAssemblies.Add("system.dll")
cp.ReferencedAssemblies.Add("system.xml.dll")
cp.ReferencedAssemblies.Add("system.data.dll")
cp.ReferencedAssemblies.Add("rylCoder.exe")
' Sample code for adding your own referenced assemblies
cp.CompilerOptions = "/t:library"
cp.GenerateInMemory = True
Dim sb As StringBuilder = New StringBuilder("")
sb.Append("Imports System" & vbCrLf)
sb.Append("Imports System.Xml" & vbCrLf)
sb.Append("Imports System.Data" & vbCrLf)
sb.Append("Imports System.Data.SqlClient" & vbCrLf)
sb.Append("Imports rylCoder" & vbCrLf)
sb.Append("Class PABLib " & vbCrLf)
sb.Append("public shared function EvalCode(ByVal params() as CGsfCoder.SParamElem) as Object " & vbCrLf)
'sb.Append("YourNamespace.YourBaseClass thisObject = New YourNamespace.YourBaseClass()")
sb.Append(vbCode & vbCrLf)
sb.Append("End Function " & vbCrLf)
sb.Append("End Class " & vbCrLf)
Dim cr As CompilerResults = icc.CompileAssemblyFromSource(cp, sb.ToString())
For Each k As String In cr.Output
Debug.WriteLine(k)
Next
Dim a As System.Reflection.Assembly = cr.CompiledAssembly
Dim o As Object
o = a.CreateInstance("PABLib")
Dim t As Type = o.GetType()
Return t.GetMethod("EvalCode")
End Function
End Class

View File

@@ -0,0 +1,318 @@
Public Class CMcfCoder
#Region "Data"
Private Shared table()() As Byte = _
{ _
New Byte() {&HAC, &H29, &H55, &H42}, _
New Byte() {&HAD, &H28, &H54, &H43}, _
New Byte() {&HAE, &H2B, &H57, &H40}, _
New Byte() {&HAF, &H2A, &H56, &H41}, _
New Byte() {&HA8, &H2D, &H51, &H46}, _
New Byte() {&HA9, &H2C, &H50, &H47}, _
New Byte() {&HAA, &H2F, &H53, &H44}, _
New Byte() {&HAB, &H2E, &H52, &H45}, _
New Byte() {&HA4, &H21, &H5D, &H4A}, _
New Byte() {&HA5, &H20, &H5C, &H4B}, _
New Byte() {&HA6, &H23, &H5F, &H48}, _
New Byte() {&HA7, &H22, &H5E, &H49}, _
New Byte() {&HA0, &H25, &H59, &H4E}, _
New Byte() {&HA1, &H24, &H58, &H4F}, _
New Byte() {&HA2, &H27, &H5B, &H4C}, _
New Byte() {&HA3, &H26, &H5A, &H4D}, _
New Byte() {&HBC, &H39, &H45, &H52}, _
New Byte() {&HBD, &H38, &H44, &H53}, _
New Byte() {&HBE, &H3B, &H47, &H50}, _
New Byte() {&HBF, &H3A, &H46, &H51}, _
New Byte() {&HB8, &H3D, &H41, &H56}, _
New Byte() {&HB9, &H3C, &H40, &H57}, _
New Byte() {&HBA, &H3F, &H43, &H54}, _
New Byte() {&HBB, &H3E, &H42, &H55}, _
New Byte() {&HB4, &H31, &H4D, &H5A}, _
New Byte() {&HB5, &H30, &H4C, &H5B}, _
New Byte() {&HB6, &H33, &H4F, &H58}, _
New Byte() {&HB7, &H32, &H4E, &H59}, _
New Byte() {&HB0, &H35, &H49, &H5E}, _
New Byte() {&HB1, &H34, &H48, &H5F}, _
New Byte() {&HB2, &H37, &H4B, &H5C}, _
New Byte() {&HB3, &H36, &H4A, &H5D}, _
New Byte() {&H8C, &H9, &H75, &H62}, _
New Byte() {&H8D, &H8, &H74, &H63}, _
New Byte() {&H8E, &HB, &H77, &H60}, _
New Byte() {&H8F, &HA, &H76, &H61}, _
New Byte() {&H88, &HD, &H71, &H66}, _
New Byte() {&H89, &HC, &H70, &H67}, _
New Byte() {&H8A, &HF, &H73, &H64}, _
New Byte() {&H8B, &HE, &H72, &H65}, _
New Byte() {&H84, &H1, &H7D, &H6A}, _
New Byte() {&H85, &H0, &H7C, &H6B}, _
New Byte() {&H86, &H3, &H7F, &H68}, _
New Byte() {&H87, &H2, &H7E, &H69}, _
New Byte() {&H80, &H5, &H79, &H6E}, _
New Byte() {&H81, &H4, &H78, &H6F}, _
New Byte() {&H82, &H7, &H7B, &H6C}, _
New Byte() {&H83, &H6, &H7A, &H6D}, _
New Byte() {&H9C, &H19, &H65, &H72}, _
New Byte() {&H9D, &H18, &H64, &H73}, _
New Byte() {&H9E, &H1B, &H67, &H70}, _
New Byte() {&H9F, &H1A, &H66, &H71}, _
New Byte() {&H98, &H1D, &H61, &H76}, _
New Byte() {&H99, &H1C, &H60, &H77}, _
New Byte() {&H9A, &H1F, &H63, &H74}, _
New Byte() {&H9B, &H1E, &H62, &H75}, _
New Byte() {&H94, &H11, &H6D, &H7A}, _
New Byte() {&H95, &H10, &H6C, &H7B}, _
New Byte() {&H96, &H13, &H6F, &H78}, _
New Byte() {&H97, &H12, &H6E, &H79}, _
New Byte() {&H90, &H15, &H69, &H7E}, _
New Byte() {&H91, &H14, &H68, &H7F}, _
New Byte() {&H92, &H17, &H6B, &H7C}, _
New Byte() {&H93, &H16, &H6A, &H7D}, _
New Byte() {&HEC, &H69, &H15, &H2}, _
New Byte() {&HED, &H68, &H14, &H3}, _
New Byte() {&HEE, &H6B, &H17, &H0}, _
New Byte() {&HEF, &H6A, &H16, &H1}, _
New Byte() {&HE8, &H6D, &H11, &H6}, _
New Byte() {&HE9, &H6C, &H10, &H7}, _
New Byte() {&HEA, &H6F, &H13, &H4}, _
New Byte() {&HEB, &H6E, &H12, &H5}, _
New Byte() {&HE4, &H61, &H1D, &HA}, _
New Byte() {&HE5, &H60, &H1C, &HB}, _
New Byte() {&HE6, &H63, &H1F, &H8}, _
New Byte() {&HE7, &H62, &H1E, &H9}, _
New Byte() {&HE0, &H65, &H19, &HE}, _
New Byte() {&HE1, &H64, &H18, &HF}, _
New Byte() {&HE2, &H67, &H1B, &HC}, _
New Byte() {&HE3, &H66, &H1A, &HD}, _
New Byte() {&HFC, &H79, &H5, &H12}, _
New Byte() {&HFD, &H78, &H4, &H13}, _
New Byte() {&HFE, &H7B, &H7, &H10}, _
New Byte() {&HFF, &H7A, &H6, &H11}, _
New Byte() {&HF8, &H7D, &H1, &H16}, _
New Byte() {&HF9, &H7C, &H0, &H17}, _
New Byte() {&HFA, &H7F, &H3, &H14}, _
New Byte() {&HFB, &H7E, &H2, &H15}, _
New Byte() {&HF4, &H71, &HD, &H1A}, _
New Byte() {&HF5, &H70, &HC, &H1B}, _
New Byte() {&HF6, &H73, &HF, &H18}, _
New Byte() {&HF7, &H72, &HE, &H19}, _
New Byte() {&HF0, &H75, &H9, &H1E}, _
New Byte() {&HF1, &H74, &H8, &H1F}, _
New Byte() {&HF2, &H77, &HB, &H1C}, _
New Byte() {&HF3, &H76, &HA, &H1D}, _
New Byte() {&HCC, &H49, &H35, &H22}, _
New Byte() {&HCD, &H48, &H34, &H23}, _
New Byte() {&HCE, &H4B, &H37, &H20}, _
New Byte() {&HCF, &H4A, &H36, &H21}, _
New Byte() {&HC8, &H4D, &H31, &H26}, _
New Byte() {&HC9, &H4C, &H30, &H27}, _
New Byte() {&HCA, &H4F, &H33, &H24}, _
New Byte() {&HCB, &H4E, &H32, &H25}, _
New Byte() {&HC4, &H41, &H3D, &H2A}, _
New Byte() {&HC5, &H40, &H3C, &H2B}, _
New Byte() {&HC6, &H43, &H3F, &H28}, _
New Byte() {&HC7, &H42, &H3E, &H29}, _
New Byte() {&HC0, &H45, &H39, &H2E}, _
New Byte() {&HC1, &H44, &H38, &H2F}, _
New Byte() {&HC2, &H47, &H3B, &H2C}, _
New Byte() {&HC3, &H46, &H3A, &H2D}, _
New Byte() {&HDC, &H59, &H25, &H32}, _
New Byte() {&HDD, &H58, &H24, &H33}, _
New Byte() {&HDE, &H5B, &H27, &H30}, _
New Byte() {&HDF, &H5A, &H26, &H31}, _
New Byte() {&HD8, &H5D, &H21, &H36}, _
New Byte() {&HD9, &H5C, &H20, &H37}, _
New Byte() {&HDA, &H5F, &H23, &H34}, _
New Byte() {&HDB, &H5E, &H22, &H35}, _
New Byte() {&HD4, &H51, &H2D, &H3A}, _
New Byte() {&HD5, &H50, &H2C, &H3B}, _
New Byte() {&HD6, &H53, &H2F, &H38}, _
New Byte() {&HD7, &H52, &H2E, &H39}, _
New Byte() {&HD0, &H55, &H29, &H3E}, _
New Byte() {&HD1, &H54, &H28, &H3F}, _
New Byte() {&HD2, &H57, &H2B, &H3C}, _
New Byte() {&HD3, &H56, &H2A, &H3D}, _
New Byte() {&H2C, &HA9, &HD5, &HC2}, _
New Byte() {&H2D, &HA8, &HD4, &HC3}, _
New Byte() {&H2E, &HAB, &HD7, &HC0}, _
New Byte() {&H2F, &HAA, &HD6, &HC1}, _
New Byte() {&H28, &HAD, &HD1, &HC6}, _
New Byte() {&H29, &HAC, &HD0, &HC7}, _
New Byte() {&H2A, &HAF, &HD3, &HC4}, _
New Byte() {&H2B, &HAE, &HD2, &HC5}, _
New Byte() {&H24, &HA1, &HDD, &HCA}, _
New Byte() {&H25, &HA0, &HDC, &HCB}, _
New Byte() {&H26, &HA3, &HDF, &HC8}, _
New Byte() {&H27, &HA2, &HDE, &HC9}, _
New Byte() {&H20, &HA5, &HD9, &HCE}, _
New Byte() {&H21, &HA4, &HD8, &HCF}, _
New Byte() {&H22, &HA7, &HDB, &HCC}, _
New Byte() {&H23, &HA6, &HDA, &HCD}, _
New Byte() {&H3C, &HB9, &HC5, &HD2}, _
New Byte() {&H3D, &HB8, &HC4, &HD3}, _
New Byte() {&H3E, &HBB, &HC7, &HD0}, _
New Byte() {&H3F, &HBA, &HC6, &HD1}, _
New Byte() {&H38, &HBD, &HC1, &HD6}, _
New Byte() {&H39, &HBC, &HC0, &HD7}, _
New Byte() {&H3A, &HBF, &HC3, &HD4}, _
New Byte() {&H3B, &HBE, &HC2, &HD5}, _
New Byte() {&H34, &HB1, &HCD, &HDA}, _
New Byte() {&H35, &HB0, &HCC, &HDB}, _
New Byte() {&H36, &HB3, &HCF, &HD8}, _
New Byte() {&H37, &HB2, &HCE, &HD9}, _
New Byte() {&H30, &HB5, &HC9, &HDE}, _
New Byte() {&H31, &HB4, &HC8, &HDF}, _
New Byte() {&H32, &HB7, &HCB, &HDC}, _
New Byte() {&H33, &HB6, &HCA, &HDD}, _
New Byte() {&HC, &H89, &HF5, &HE2}, _
New Byte() {&HD, &H88, &HF4, &HE3}, _
New Byte() {&HE, &H8B, &HF7, &HE0}, _
New Byte() {&HF, &H8A, &HF6, &HE1}, _
New Byte() {&H8, &H8D, &HF1, &HE6}, _
New Byte() {&H9, &H8C, &HF0, &HE7}, _
New Byte() {&HA, &H8F, &HF3, &HE4}, _
New Byte() {&HB, &H8E, &HF2, &HE5}, _
New Byte() {&H4, &H81, &HFD, &HEA}, _
New Byte() {&H5, &H80, &HFC, &HEB}, _
New Byte() {&H6, &H83, &HFF, &HE8}, _
New Byte() {&H7, &H82, &HFE, &HE9}, _
New Byte() {&H0, &H85, &HF9, &HEE}, _
New Byte() {&H1, &H84, &HF8, &HEF}, _
New Byte() {&H2, &H87, &HFB, &HEC}, _
New Byte() {&H3, &H86, &HFA, &HED}, _
New Byte() {&H1C, &H99, &HE5, &HF2}, _
New Byte() {&H1D, &H98, &HE4, &HF3}, _
New Byte() {&H1E, &H9B, &HE7, &HF0}, _
New Byte() {&H1F, &H9A, &HE6, &HF1}, _
New Byte() {&H18, &H9D, &HE1, &HF6}, _
New Byte() {&H19, &H9C, &HE0, &HF7}, _
New Byte() {&H1A, &H9F, &HE3, &HF4}, _
New Byte() {&H1B, &H9E, &HE2, &HF5}, _
New Byte() {&H14, &H91, &HED, &HFA}, _
New Byte() {&H15, &H90, &HEC, &HFB}, _
New Byte() {&H16, &H93, &HEF, &HF8}, _
New Byte() {&H17, &H92, &HEE, &HF9}, _
New Byte() {&H10, &H95, &HE9, &HFE}, _
New Byte() {&H11, &H94, &HE8, &HFF}, _
New Byte() {&H12, &H97, &HEB, &HFC}, _
New Byte() {&H13, &H96, &HEA, &HFD}, _
New Byte() {&H6C, &HE9, &H95, &H82}, _
New Byte() {&H6D, &HE8, &H94, &H83}, _
New Byte() {&H6E, &HEB, &H97, &H80}, _
New Byte() {&H6F, &HEA, &H96, &H81}, _
New Byte() {&H68, &HED, &H91, &H86}, _
New Byte() {&H69, &HEC, &H90, &H87}, _
New Byte() {&H6A, &HEF, &H93, &H84}, _
New Byte() {&H6B, &HEE, &H92, &H85}, _
New Byte() {&H64, &HE1, &H9D, &H8A}, _
New Byte() {&H65, &HE0, &H9C, &H8B}, _
New Byte() {&H66, &HE3, &H9F, &H88}, _
New Byte() {&H67, &HE2, &H9E, &H89}, _
New Byte() {&H60, &HE5, &H99, &H8E}, _
New Byte() {&H61, &HE4, &H98, &H8F}, _
New Byte() {&H62, &HE7, &H9B, &H8C}, _
New Byte() {&H63, &HE6, &H9A, &H8D}, _
New Byte() {&H7C, &HF9, &H85, &H92}, _
New Byte() {&H7D, &HF8, &H84, &H93}, _
New Byte() {&H7E, &HFB, &H87, &H90}, _
New Byte() {&H7F, &HFA, &H86, &H91}, _
New Byte() {&H78, &HFD, &H81, &H96}, _
New Byte() {&H79, &HFC, &H80, &H97}, _
New Byte() {&H7A, &HFF, &H83, &H94}, _
New Byte() {&H7B, &HFE, &H82, &H95}, _
New Byte() {&H74, &HF1, &H8D, &H9A}, _
New Byte() {&H75, &HF0, &H8C, &H9B}, _
New Byte() {&H76, &HF3, &H8F, &H98}, _
New Byte() {&H77, &HF2, &H8E, &H99}, _
New Byte() {&H70, &HF5, &H89, &H9E}, _
New Byte() {&H71, &HF4, &H88, &H9F}, _
New Byte() {&H72, &HF7, &H8B, &H9C}, _
New Byte() {&H73, &HF6, &H8A, &H9D}, _
New Byte() {&H4C, &HC9, &HB5, &HA2}, _
New Byte() {&H4D, &HC8, &HB4, &HA3}, _
New Byte() {&H4E, &HCB, &HB7, &HA0}, _
New Byte() {&H4F, &HCA, &HB6, &HA1}, _
New Byte() {&H48, &HCD, &HB1, &HA6}, _
New Byte() {&H49, &HCC, &HB0, &HA7}, _
New Byte() {&H4A, &HCF, &HB3, &HA4}, _
New Byte() {&H4B, &HCE, &HB2, &HA5}, _
New Byte() {&H44, &HC1, &HBD, &HAA}, _
New Byte() {&H45, &HC0, &HBC, &HAB}, _
New Byte() {&H46, &HC3, &HBF, &HA8}, _
New Byte() {&H47, &HC2, &HBE, &HA9}, _
New Byte() {&H40, &HC5, &HB9, &HAE}, _
New Byte() {&H41, &HC4, &HB8, &HAF}, _
New Byte() {&H42, &HC7, &HBB, &HAC}, _
New Byte() {&H43, &HC6, &HBA, &HAD}, _
New Byte() {&H5C, &HD9, &HA5, &HB2}, _
New Byte() {&H5D, &HD8, &HA4, &HB3}, _
New Byte() {&H5E, &HDB, &HA7, &HB0}, _
New Byte() {&H5F, &HDA, &HA6, &HB1}, _
New Byte() {&H58, &HDD, &HA1, &HB6}, _
New Byte() {&H59, &HDC, &HA0, &HB7}, _
New Byte() {&H5A, &HDF, &HA3, &HB4}, _
New Byte() {&H5B, &HDE, &HA2, &HB5}, _
New Byte() {&H54, &HD1, &HAD, &HBA}, _
New Byte() {&H55, &HD0, &HAC, &HBB}, _
New Byte() {&H56, &HD3, &HAF, &HB8}, _
New Byte() {&H57, &HD2, &HAE, &HB9}, _
New Byte() {&H50, &HD5, &HA9, &HBE}, _
New Byte() {&H51, &HD4, &HA8, &HBF}, _
New Byte() {&H52, &HD7, &HAB, &HBC}, _
New Byte() {&H53, &HD6, &HAA, &HBD} _
}
#End Region
Public Enum Col
EFirstCol = 0
ESecondCol = 1
EThirdCol = 2
EForthCol = 3
End Enum
Public Shared Function DeCryptByte(ByVal num As Byte, Optional ByVal column As Col = Col.EFirstCol) As Byte
Dim i As Byte = 0
For Each t As Byte() In table
If Array.IndexOf(t, num) = column Then Return i
i += 1
Next
Debug.WriteLine("Error decrypting &H" & Hex(num) & " in column " & printCol(column))
Return 0
End Function
Public Shared Function EnCryptByte(ByVal num As Byte, Optional ByVal column As Col = Col.EFirstCol) As Byte
Return table(num)(column)
End Function
Public Shared Function DeCryptArea(ByRef data As Byte(), Optional ByVal startCol As Col = Col.EFirstCol) As Byte()
Dim out(data.Length) As Byte
Dim pos As Integer = startCol
Dim i As Long = 0
For Each b As Byte In data
out(i) = DeCryptByte(b, pos)
pos += 1
i += 1
If pos > 3 Then pos = 0
Next
Return out
End Function
Public Shared Function EnCryptArea(ByRef data As Byte(), Optional ByVal startCol As Col = Col.EFirstCol) As Byte()
Dim out(data.Length) As Byte
Dim pos As Integer = startCol
Dim i As Long = 0
For Each b As Byte In data
out(i) = EnCryptByte(b, pos)
pos += 1
i += 1
If pos > 3 Then pos = 0
Next
Return out
End Function
Private Shared Function printCol(ByVal column As Col) As Integer
Select Case column
Case Col.EFirstCol : Return 0
Case Col.ESecondCol : Return 1
Case Col.EThirdCol : Return 2
Case Col.EForthCol : Return 3
End Select
End Function
End Class

View File

@@ -0,0 +1,20 @@
Imports System
Imports System.IO
Imports System.Drawing.Imaging
Public Class CMiniMap
' Fields
Private Const FileMask As String = "{0}\Texture\Widetexture\Zone{1}\{2}_{3}.dds"
Public Const TilesPainted As Integer = 11
' Methods
Public Shared Function CreateMap(ByVal GameFolder As String, ByVal Zone As Integer) As Bitmap
Try
If Zone = 16 Then Zone = 8
Return FischR.Wrapper.LoadMapDDS(String.Format(FileMask, GameFolder, Zone, "{0}", "{1}"))
Catch ex As Exception
MessageBox.Show(ex.ToString, ex.Message)
Return Nothing
End Try
End Function
End Class

View File

@@ -0,0 +1,343 @@
'################################################
'## ##
'## RYL mcf & gsf file editor ##
'## ##
'## (C) 2006 & 2007 AlphA ##
'## ##
'## This source is for private development. ##
'## You can have this source only with the ##
'## owners permission. ##
'## ##
'################################################
Public Class CNpcParser
Public NPCs As npcStruct() = {}
Private notFoundNPCLines As New ArrayList 'LineWithPos() = {}
Private Functions As CMcfBase.SFunction() = {}
Public loadedNPC As npcStruct = Nothing
Public RYLVersion As Integer = 0
Public Structure NPCline
Dim NPCID As Long
Dim Params As CMcfBase.SParamElem()
Dim Type As knownType
Dim pos As Long
Dim ownerFunc As Integer
Public Enum knownType
EAddItem = 1
ESetPosition = 2
EAddPopup = 3
EAddWords = 4
EAddDialog = 5
ESetNPC = 6
EAddQuestWords = 7
EAddZoneMove = 8
EAddQuest = 9
ESetDropBase = 10
ESetDropGrade = 11
ESetNPCAttribute = 12
End Enum
Public Shared TypesStrings As String() = { _
"", _
"AddItem", _
"SetPosition", _
"AddPopup", _
"AddWords", _
"AddDialog", _
"SetNPC", _
"AddQuestWords", _
"AddZoneMove", _
"AddQuest", _
"SetDropBase", _
"SetDropGrade", _
"SetNPCAttribute" _
}
End Structure
Public Class npcStruct
Public id As Long
Public iLines As New ArrayList 'NPCLine
Public RYLversion As Integer = 0
Public Sub New()
End Sub
Public Sub New(ByVal aId As Long, ByVal version As Integer)
id = aId
RYLversion = version
End Sub
Public Sub AddLine(ByVal com As NPCline)
If iLines.Count > 0 Then com.ownerFunc = CType(iLines(0), NPCline).ownerFunc
iLines.Add(com)
End Sub
Public Sub DeleteLine(ByVal line As NPCline)
iLines.Remove(line)
End Sub
Public ReadOnly Property Name() As String
Get
For Each l As NPCline In iLines
If l.Type = NPCline.knownType.ESetNPC Then
If RYLversion = 1 Then
Return l.Params(4).value
Else
Return l.Params(5).value
End If
End If
Next
Return ""
End Get
End Property
Public ReadOnly Property Map() As Long
Get
For Each l As NPCline In iLines
If l.Type = NPCline.knownType.ESetNPC Then
Return l.Params(0).value
End If
Next
Return "??"
End Get
End Property
Public Property Lines(Optional ByVal type As NPCline.knownType = Nothing) As NPCline()
Get
Dim tLines As New ArrayList
For Each l As NPCline In iLines
If type = Nothing OrElse l.Type = type Then
tLines.Add(l)
End If
Next
Return tLines.ToArray(GetType(NPCline))
End Get
Set(ByVal value As NPCline())
Dim tLines As New ArrayList
For Each l As NPCline In iLines
If Not type = Nothing AndAlso l.Type <> type Then
tLines.Add(l)
End If
Next
For Each v As NPCline In value
tLines.Add(v)
Next
iLines = tLines
End Set
End Property
Default Public Property Item(ByVal index As Integer) As NPCline
Get
Return iLines(index)
End Get
Set(ByVal value As NPCline)
iLines(index) = value
End Set
End Property
Public Function indexOfPos(ByVal pos As Long)
Dim i As Long = 0
For Each l As NPCline In iLines
If l.pos = pos Then
Return i
End If
i += 1
Next
Return -1
End Function
Public Sub SwitchPositions(ByVal pos1 As Long, ByVal pos2 As Long)
Dim index1 As Long = indexOfPos(pos1)
Dim index2 As Long = indexOfPos(pos2)
If index1 >= 0 AndAlso index2 >= 0 AndAlso index1 <> index2 Then
Dim item1 As NPCline = iLines(index1)
Dim item2 As NPCline = iLines(index2)
item1.pos = pos2
item2.pos = pos1
iLines(index1) = item2
iLines(index2) = item1
End If
End Sub
Public Sub setParameter(ByVal pos As Long, ByVal paramIndex As Integer, ByVal value As Object)
Dim index As Long = indexOfPos(pos)
If index >= 0 Then
Dim item As NPCline = iLines(index)
item.Params(paramIndex).value = value
iLines(index) = item
End If
End Sub
Public Sub setPos(ByVal pos As Long, ByVal newPos As Long)
Dim index As Long = indexOfPos(pos)
If index >= 0 Then
Dim item As NPCline = iLines(index)
item.pos = newPos
iLines(index) = item
End If
End Sub
End Class
Private Structure LineWithPos
Dim line As CMcfBase.SScriptLine
Dim pos As Long
Dim ownerFunction As Integer
End Structure
Private Function indexOfNPCinLines(ByVal NPCid As Long) As Long
Dim i As Long = 0
For Each npc As npcStruct In NPCs
If npc.id = NPCid Then Return i
i += 1
Next
Return -1
End Function
Public Sub Parse(ByVal funcs As CMcfBase.SFunction())
Array.Resize(NPCs, 0)
Functions = funcs
Dim npclines As New ArrayList
Dim i As Long = 0
For Each f As CMcfBase.SFunction In funcs
For Each v As CMcfBase.SScriptLine In f.data
Dim l As Integer = Array.IndexOf(NPCline.TypesStrings, funcs(v.callTo).name)
If l >= 0 Then
Dim nLine As New NPCline
nLine.Type = l
nLine.Params = v.parameters
nLine.pos = i
nLine.ownerFunc = f.id
npclines.Add(nLine)
If nLine.Type = NPCline.knownType.ESetNPC Then
If RYLVersion < 1 Then RYLVersion = IIf(nLine.Params.Length > 5, 2, 1)
ReDim Preserve NPCs(UBound(NPCs) + 1)
NPCs(UBound(NPCs)) = New npcStruct(nLine.Params(1).value, RYLVersion)
nLine.NPCID = nLine.Params(1).value
NPCs(UBound(NPCs)).AddLine(nLine)
Else
Dim npcI As Long = indexOfNPCinLines(nLine.Params(0).value)
If npcI >= 0 Then
nLine.NPCID = nLine.Params(0).value
NPCs(npcI).AddLine(nLine)
Else
Dim vv As New LineWithPos
vv.line = v
vv.pos = i
vv.ownerFunction = f.id
notFoundNPCLines.Add(vv)
End If
End If
Else
Dim vv As New LineWithPos
vv.line = v
vv.pos = i
vv.ownerFunction = f.id
notFoundNPCLines.Add(vv)
End If
i += 1
Next
Next
End Sub
Public Function GetFunctions() As CMcfBase.SFunction()
Dim lines As New ArrayList 'linewith pos
Dim ucnt As Long = 0
For i As Long = 0 To NPCs.Length - 1
Dim ls As NPCline() = NPCs(i).Lines()
For Each l As NPCline In ls
Dim ln As New CMcfBase.SScriptLine
Dim lp As New LineWithPos
ln.parameters = l.Params
For Each f As CMcfBase.SFunction In Functions
If f.name = NPCline.TypesStrings(l.Type) Then
ln.callTo = f.id
Exit For
End If
Next
lp.ownerFunction = l.ownerFunc
lp.line = ln
lp.pos = l.pos
lines.Add(lp)
ucnt += 1
Next
Next
For Each l As LineWithPos In notFoundNPCLines
lines.Add(l)
ucnt += 1
Next
lines.Sort(New linePosComparer)
Dim ki As Long = 0
For i As Integer = 0 To Functions.Length - 1
Functions(i).data = New CMcfBase.SScriptLine() {}
Next
For Each l As LineWithPos In lines
Dim f As CMcfBase.SFunction = Functions(l.ownerFunction)
ReDim Preserve f.data(UBound(f.data) + 1)
f.data(UBound(f.data)) = l.line
Functions(l.ownerFunction) = f
Next
Return Functions
End Function
Public Class linePosComparer
Implements IComparer
Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements IComparer.Compare
Dim lX As LineWithPos = CType(x, LineWithPos)
Dim lY As LineWithPos = CType(y, LineWithPos)
Return New CaseInsensitiveComparer().Compare(lX.pos, lY.pos)
End Function
End Class
Public Class NPClinePosComparer
Implements IComparer
Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements IComparer.Compare
Dim lX As NPCline = CType(x, NPCline)
Dim lY As NPCline = CType(y, NPCline)
Return New CaseInsensitiveComparer().Compare(lX.pos, lY.pos)
End Function
End Class
Public Class FreePoslinePosComparer
Implements IComparer
Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements IComparer.Compare
Dim lX As freePosItem = CType(x, freePosItem)
Dim lY As freePosItem = CType(y, freePosItem)
Return New CaseInsensitiveComparer().Compare(lX.pos, lY.pos)
End Function
End Class
Public Structure NPCTextItem
Dim line As NPCline
Dim text As String
Dim paraIndex As Integer
Dim Tag As Object
End Structure
Private Structure freePosItem
Dim npcL As NPCline
Dim sLine As CMcfBase.SScriptLine
Dim pos As Long
Dim isNPCLine As Boolean
End Structure
Public Sub FreePosition(ByVal pos As Long, Optional ByVal length As Integer = 1)
Dim lines As New ArrayList
For Each npc As npcStruct In NPCs
For Each l As NPCline In npc.iLines
Dim nFPitem As New freePosItem
nFPitem.pos = l.pos
nFPitem.isNPCLine = True
nFPitem.npcL = l
lines.Add(nFPitem)
Next
npc.iLines.Clear()
Next
If notFoundNPCLines.Count > 0 Then
For Each l As LineWithPos In notFoundNPCLines
Dim nFPitem As New freePosItem
nFPitem.pos = l.pos
nFPitem.isNPCLine = False
nFPitem.sLine = l.line
lines.Add(nFPitem)
Next
notFoundNPCLines.Clear()
End If
lines.Sort(New FreePoslinePosComparer)
Dim nPos As Long = 0
For Each l As freePosItem In lines
If nPos = pos Then nPos += length
If l.isNPCLine Then
Dim nL As NPCline = l.npcL
nL.pos = nPos
NPCs(indexOfNPCinLines(nL.NPCID)).AddLine(nL)
Else
Dim nL As New LineWithPos
nL.line = l.sLine
nL.pos = nPos
notFoundNPCLines.Add(nL)
End If
nPos += 1
Next
End Sub
End Class

View File

@@ -0,0 +1,580 @@
'################################################
'## ##
'## RYL mcf & gsf file editor ##
'## ##
'## (C) 2006 & 2007 AlphA ##
'## ##
'## This source is for private development. ##
'## You can have this source only with the ##
'## owners permission. ##
'## ##
'################################################
Public Class CQuestParser
'Private Const CIdLen As Integer = 4 'like 0xF704 => Len("F704")
Public Quests() As Quest = {}
Private iFuncs As CMcfBase.SFunction() = Nothing
'Private UnknownLines As New List(Of QLine) ' we dont use positions here so cant really seperate them
Public openQuest As Quest = Nothing
Public OpenPhase As QuestPhase = Nothing
Public rylVersion As Integer = 2
Public Function AddNewQuest() As Quest
Dim q As New Quest
If rylVersion = 1 Then
q.IdString = "myQuest" & Now.Millisecond.ToString()
Dim f As New CMcfBase.SFunction
f.data = New CMcfBase.SScriptLine() {}
f.id = UBound(iFuncs) + 1
f.isExternal = False
f.name = q.IdString
f.parameterTypes = New CMcfBase.DataType() {}
f.returnType = CMcfBase.DataType.EInteger
ReDim Preserve iFuncs(UBound(iFuncs) + 1)
iFuncs(UBound(iFuncs)) = f
Dim ql As New QLine() 'do first manually to set the owner function
ql.params = New CMcfBase.SParamElem() {CMcfBase.CreateParamElem(CMcfBase.DataType.EBool, 1)}
ql.ownerFunction = UBound(iFuncs)
ql.Type = QLine.KnownType.EQuestCompleteSave
q.AddLine(ql)
q.CreateLine(QLine.KnownType.EQuestTitle, CMcfBase.DataType.EString, "New quest")
q.CreateLine(QLine.KnownType.EQuestLevel, CMcfBase.DataType.EString, "LV 1~95")
q.CreateLine(QLine.KnownType.EQuestAward, CMcfBase.DataType.EString, "- Experience 1\\- Gold 1")
q.CreateLine(QLine.KnownType.EQuestDesc, CMcfBase.DataType.EString, "New quest description")
q.CreateLine(QLine.KnownType.EQuestShortDesc, CMcfBase.DataType.EString, "")
q.CreateLine(QLine.KnownType.EQuestIcon, New CMcfBase.SParamElem() { _
CMcfBase.CreateParamElem(CMcfBase.DataType.EString, "Quest_misc01.dds"), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 84), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 114), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 126), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 156) _
})
Else
Dim prevId As Integer = 0
For Each mq As Quest In Quests
Dim qid As Integer = mq.Id
If qid > &HF000 Then qid -= &HF000
If qid > prevId Then prevId = qid
Next
q.Id = prevId + 1
q.CreateLine(QLine.KnownType.EQuestStart, New CMcfBase.SParamElem() { _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, q.Id), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 1), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 95), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, &HFF0FFF), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 0), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 0), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EBool, 0) _
})
q.CreateLine(QLine.KnownType.EQuestType, New CMcfBase.SParamElem() { _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 0), _
CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, 1) _
})
q.CreateLine(QLine.KnownType.EQuestCompleteSave, CMcfBase.DataType.EBool, 1)
q.CreateLine(QLine.KnownType.EQuestTitle, CMcfBase.DataType.EString, "New quest")
q.CreateLine(QLine.KnownType.EQuestLevel, CMcfBase.DataType.EString, "LV 1")
q.CreateLine(QLine.KnownType.EQuestAward, CMcfBase.DataType.EString, "- Experience 1\\- Gold 1")
q.CreateLine(QLine.KnownType.EQuestDesc, CMcfBase.DataType.EString, "New quest description")
q.CreateLine(QLine.KnownType.EQuestShortDesc, CMcfBase.DataType.EString, "")
q.CreateLine(QLine.KnownType.EQuestEnd)
End If
ReDim Preserve Quests(UBound(Quests) + 1)
Quests(UBound(Quests)) = q
Return Quests(UBound(Quests))
End Function
Public Sub DeleteQuest(ByRef q As Quest)
Dim arrl As New ArrayList
For Each l As Quest In Quests
If Not l Is q Then arrl.Add(l)
Next
Quests = arrl.ToArray(GetType(Quest))
End Sub
Public Sub Parse(ByVal funcs As CMcfBase.SFunction())
iFuncs = funcs
Array.Resize(Quests, 0)
If rylVersion = 1 Then
For Each f As CMcfBase.SFunction In funcs
If Not f.isExternal AndAlso f.name <> "" AndAlso f.data.Length > 0 Then
Dim q As New Quest(f.id, f.name)
For Each l As CMcfBase.SScriptLine In f.data
Dim qL As New QLine(l, QLine.String2Type(funcs(l.callTo).name))
qL.ownerFunction = f.id
q.AddLine(qL)
Next
ReDim Preserve Quests(UBound(Quests) + 1)
Quests(UBound(Quests)) = q
Else
'For Each l As CMcfBase.SScriptLine In f.data
' UnknownLines.Add(New QLine(l, QLine.String2Type(funcs(l.callTo).name)))
'Next
End If
Next
Else
Dim goingQ As Long = -1
For Each f As CMcfBase.SFunction In funcs
For Each l As CMcfBase.SScriptLine In f.data
Dim qL As New QLine(l, QLine.String2Type(funcs(l.callTo).name))
qL.ownerFunction = f.id
If qL.Type = QLine.KnownType.EQuestStart Then
Dim qId As Integer = qL.params(0).value
Dim q As New Quest(qId)
goingQ += 1
q.AddLine(qL)
ReDim Preserve Quests(goingQ)
Quests(goingQ) = q
ElseIf goingQ >= 0 Then
Quests(goingQ).AddLine(qL)
Else
'UnknownLines.Add(qL)
End If
Next
Next
End If
End Sub
Public Function GetFunctions() As CMcfBase.SFunction()
For i As Integer = 0 To iFuncs.Length - 1
iFuncs(i).data = New CMcfBase.SScriptLine() {}
Next
For i As Long = 0 To Quests.Length - 1
Dim ls As QLine() = Quests(i).iLines
For Each l As QLine In ls
Dim ln As New CMcfBase.SScriptLine
ln.parameters = l.params
For Each f As CMcfBase.SFunction In iFuncs
If f.name = QLine.Type2String(l.Type) Then
ln.callTo = f.id
Exit For
End If
Next
Dim f2 As CMcfBase.SFunction = iFuncs(l.ownerFunction)
ReDim Preserve f2.data(UBound(f2.data) + 1)
f2.data(UBound(f2.data)) = ln
f2.name = Quests(i).IdString
iFuncs(l.ownerFunction) = f2
Next
Next
Dim funcs As New List(Of CMcfBase.SFunction)
For i As Integer = 0 To iFuncs.Length - 1
If iFuncs(i).isExternal OrElse iFuncs(i).data.Length > 0 OrElse iFuncs(i).name = "" Then funcs.Add(iFuncs(i))
Next
iFuncs = funcs.ToArray()
Return iFuncs
End Function
Public Class QLine
Public params As CMcfBase.SParamElem() = {}
Public Type As KnownType
Public ownerFunction As Integer = 0
Public Sub New()
End Sub
Public Sub New(ByVal line As CMcfBase.SScriptLine, ByVal aType As KnownType)
params = line.parameters
Type = aType
End Sub
Public Enum KnownType
EQuestEnd
EQuestSkillPointBonus
EQuestStart
EQuestType
EQuestArea
EQuestTitle
EQuestDesc
EQuestShortDesc
EQuestIcon
EQuestCompleteSave
EQuestLevel
EQuestAward
EAddPhase
EPhase_Target
ETrigger_Start
ETrigger_Puton
ETrigger_Geton
ETrigger_Talk
ETrigger_Kill
ETrigger_Pick
ETrigger_Fame
ETrigger_LevelTalk
EElse
EEvent_Disappear
EEvent_Get
EEvent_Spawn
EEvent_MonsterDrop
EEvent_Award
EEvent_MsgBox
EEvent_Phase
EEvent_End
EEvent_AwardItem
EEvent_AddQuest
EEvent_Move
EEvent_TheaterMode
End Enum
Public Shared Function String2Type(ByVal txt As String) As KnownType
Return KnownType.Parse(GetType(KnownType), "E" & txt)
End Function
Public Shared Function Type2String(ByVal type As KnownType) As String
Return type.ToString.Substring(1)
End Function
End Class
Public Class Quest
Public Id As Integer
Public IdString As String 'for ryl1
Public iLines() As QLine = {}
Public Sub New()
End Sub
Public Sub New(ByVal aId As Integer, Optional ByVal aIdString As String = "")
Id = aId
IdString = aIdString
End Sub
Public Sub AddLine(ByVal com As QLine)
If iLines.Length > 0 Then com.ownerFunction = iLines(0).ownerFunction
ReDim Preserve iLines(UBound(iLines) + 1)
iLines(UBound(iLines)) = com
End Sub
Public Sub CreateLine(ByVal type As QLine.KnownType)
CreateLine(type, New CMcfBase.SParamElem() {})
End Sub
Public Sub CreateLine(ByVal type As QLine.KnownType, ByVal paramType As CMcfBase.DataType, ByVal obj As Object)
CreateLine(type, New CMcfBase.SParamElem() {CMcfBase.CreateParamElem(paramType, obj)})
End Sub
Public Sub CreateLine(ByVal type As QLine.KnownType, ByRef params As CMcfBase.SParamElem())
Dim nql As New QLine
nql.Type = type
nql.params = params
Me.AddLine(nql)
End Sub
Public Sub DeleteLine(ByRef line As QLine)
Dim arrl As New ArrayList
For Each l As QLine In iLines
If Not l Is line Then arrl.Add(l)
Next
iLines = arrl.ToArray(GetType(QLine))
End Sub
Public ReadOnly Property Name() As String
Get
Dim ls As QLine() = Me.Lines(QLine.KnownType.EQuestTitle)
If ls.Length = 1 Then
Return ls(0).params(0).value
Else
Return "0x" & AddMath.Hex2(Id)
End If
End Get
End Property
Public Overrides Function ToString() As String
Dim ls As QLine() = Me.Lines(QLine.KnownType.EQuestLevel)
Dim lvl As String = "LV ??"
If ls.Length = 1 Then
lvl = ls(0).params(0).value
End If
Return "[" & lvl & "]" & Me.Name
End Function
Public Property Lines(Optional ByVal type As QLine.KnownType = Nothing) As QLine()
Get
Dim tLines As New ArrayList
For Each l As QLine In iLines
If type = Nothing OrElse l.Type = type Then
tLines.Add(l)
End If
Next
Return tLines.ToArray(GetType(QLine))
End Get
Set(ByVal value As QLine())
Dim tLines As New ArrayList
For Each l As QLine In iLines
If Not type = Nothing AndAlso l.Type <> type Then
tLines.Add(l)
End If
Next
For Each v As QLine In value
tLines.Add(v)
Next
iLines = tLines.ToArray(GetType(QLine()))
End Set
End Property
Public ReadOnly Property Maps() As Integer()
Get
Dim zSs As New ArrayList
Dim ls As QLine() = Me.Lines(QLine.KnownType.EAddPhase)
For Each l As QLine In ls
If zSs.IndexOf(Convert.ToInt32(l.params(0).value)) < 0 Then zSs.Add(Convert.ToInt32(l.params(0).value))
Next
zSs.Sort()
Return zSs.ToArray(GetType(Integer))
End Get
End Property
Public Function Phases() As QuestPhase()
Dim phaseLines As New ArrayList 'type=QLine
Dim out As New ArrayList 'type=QuestPhase
Dim add As Boolean = False
For Each l As QLine In iLines
If l.Type = QLine.KnownType.EAddPhase Then
If phaseLines.Count > 0 Then
out.Add(New QuestPhase(phaseLines.ToArray(GetType(QLine))))
phaseLines.Clear()
End If
add = True
ElseIf l.Type = QLine.KnownType.EQuestEnd Then
If phaseLines.Count > 0 Then
out.Add(New QuestPhase(phaseLines.ToArray(GetType(QLine))))
phaseLines.Clear()
End If
add = False
Exit For
End If
If add Then phaseLines.Add(l)
Next
If add AndAlso phaseLines.Count > 0 Then
out.Add(New QuestPhase(phaseLines.ToArray(GetType(QLine))))
phaseLines.Clear()
End If
Return out.ToArray(GetType(QuestPhase))
End Function
Public Function getLinesForPhase(ByVal nr As Integer) As QLine()
Dim phaseLines As New ArrayList 'type=QLine
Dim adding As Boolean = False
For Each l As QLine In iLines
If l.Type = QLine.KnownType.EAddPhase Then
If l.params(1).value = nr Then
adding = True
Else
adding = False
End If
ElseIf l.Type = QLine.KnownType.EQuestEnd Then
Exit For
End If
If adding Then phaseLines.Add(l)
Next
Return phaseLines.ToArray(GetType(QLine))
End Function
End Class
Public Function questIndexForID(ByVal id As Integer) As Integer
Dim i As Integer = 0
For Each q As Quest In Quests
If q.Id = id Then
Return i
End If
i += 1
Next
Return -1
End Function
Public Class QuestPhase
Public Shared lvl3functions As QLine.KnownType() = {QLine.KnownType.ETrigger_Fame, QLine.KnownType.ETrigger_Geton, QLine.KnownType.ETrigger_Kill, QLine.KnownType.ETrigger_LevelTalk, QLine.KnownType.ETrigger_Pick, QLine.KnownType.ETrigger_Puton, QLine.KnownType.ETrigger_Start, QLine.KnownType.ETrigger_Talk}
Public Shared lvl4functions As QLine.KnownType() = {QLine.KnownType.EEvent_AddQuest, QLine.KnownType.EEvent_Award, QLine.KnownType.EEvent_AwardItem, QLine.KnownType.EEvent_Disappear, QLine.KnownType.EEvent_End, QLine.KnownType.EEvent_Get, QLine.KnownType.EEvent_MonsterDrop, QLine.KnownType.EEvent_Move, QLine.KnownType.EEvent_MsgBox, QLine.KnownType.EEvent_Phase, QLine.KnownType.EEvent_Spawn, QLine.KnownType.EEvent_TheaterMode}
Public Id As Integer = 0 'zero based
Public Zone As Integer = 0
Public Name As String = ""
Public phaseF As QLine = Nothing
Public mapPointers() As Point = {}
Public mainFunction As QLine = Nothing
Public mainFunctionSiblings() As QLine = {}
Public ElseFunction As QLine = Nothing
Public elseSiblings() As QLine = {}
Public Sub New()
End Sub
Public Sub New(ByVal lines As QLine())
If lines(0).Type <> QLine.KnownType.EAddPhase Then Throw New Exception("Invalid Quest Phase")
Zone = lines(0).params(0).value
Id = lines(0).params(1).value
Name = lines(0).params(2).value
phaseF = lines(0)
Dim running As Integer = 0
Dim lineBuf As New ArrayList
For i As Integer = 1 To lines.Length - 1
Dim l As QLine = lines(i)
If l.Type = QLine.KnownType.EPhase_Target Then
ReDim Preserve mapPointers(UBound(mapPointers) + 1)
mapPointers(UBound(mapPointers)) = New Point(l.params(0).value, l.params(1).value)
ElseIf l.Type = QLine.KnownType.EElse Then
ElseFunction = l
If running = 1 AndAlso lineBuf.Count > 0 Then
mainFunctionSiblings = lineBuf.ToArray(GetType(QLine))
lineBuf.Clear()
End If
running = 2
ElseIf Array.IndexOf(lvl3functions, l.Type) >= 0 Then
mainFunction = l
running = 1
ElseIf running > 0 Then
lineBuf.Add(l)
End If
Next
If running > 0 AndAlso lineBuf.Count > 0 Then
If running = 1 Then
mainFunctionSiblings = lineBuf.ToArray(GetType(QLine))
ElseIf running = 2 Then
elseSiblings = lineBuf.ToArray(GetType(QLine))
End If
lineBuf.Clear()
End If
End Sub
'Public Function GetQLines() As QLine()
' Dim out(mapPointers.Length + IIf(Not mainFunction Is Nothing, 1 + mainFunctionSiblings.Length, 0) + IIf(hasElseFunction, 1 + elseSiblings.Length, 0)) As QLine
' phaseF.params(0).value = Zone
' phaseF.params(1).value = Id
' phaseF.params(2).value = Name
' out(0) = phaseF
' Dim pos As Integer = 1
' For Each p As Point In mapPointers
' Dim nQL As New QLine()
' nQL.Type = QLine.KnownType.EPhase_Target
' nQL.params = New CMcfBase.SParamElem() {CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, p.X), CMcfBase.CreateParamElem(CMcfBase.DataType.EInteger, p.Y)}
' out(pos) = nQL
' pos += 1
' Next
' If Not mainFunction Is Nothing Then
' out(pos) = mainFunction
' pos += 1
' For Each f As QLine In mainFunctionSiblings
' out(pos) = f
' pos += 1
' Next
' End If
' If hasElseFunction Then
' Dim nQL As New QLine()
' nQL.params = New CMcfBase.SParamElem() {}
' nQL.Type = QLine.KnownType.EElse
' out(pos) = nQL
' pos += 1
' For Each f As QLine In elseSiblings
' out(pos) = f
' pos += 1
' Next
' End If
' Return out
'End Function
End Class
#Region "Enums"
Public Class QClassEnum
Public Enum base
EAll = &HFF0FFF 'Everyone
EAkhans = &HFF0000
EHumans = &HFFF
E0xFC0FF0 = &HFC0FF0 '<- WTF is this?!?!
E0xFC0FFF = &HFC0FFF '<- WTF is this too?!?! (fight the hard fight)
EFighter = &H1
ERogue = &H2
EMage = &H4
EAcolyte = &H8
ECombatant = &H10000
EOfficiator = &H20000
EDefender = &H10 'Fighter
EWarrior = &H20
EAssasin = &H40 'Rogue
EArcher = &H80
ESourcerer = &H100 'Mage
EEnchanter = &H200
EPriest = &H400 'Acolyte
ECleric = &H800
EGunner = &H100000 'Combatant
ETemplar = &H40000
EAttacker = &H80000
ERune = &H200000 'Officiator
ELife = &H400000
EShadow = &H800000
End Enum
Public Shared Function Type2String(ByVal type As base) As String
Return type.ToString.Substring(1)
End Function
End Class
Public Class QEQGradeEnum
Public Enum base
EAAA = 0
EAA = 1
EA = 2
EB = 3
EC = 4
ED = 5
EF = 6
End Enum
Public Shared Function Type2String(ByVal type As base) As String
Return type.ToString.Substring(1)
End Function
End Class
Public Class QEQTypeEnum
Public Enum base
'Human armor
ECON__ARMOR = 3
ECON__HELM = 4
ECON__GLOVE = 5
ECON__BOOT = 6
EDEX__ARMOUR = 7
EDEX__HELM = 8
EDEX__GLOVE = 9
EDEX__BOOTS = 10
'Human Weapon
EONEHANDED__SWORD = 11
ETWOHANDED__SWORD = 12
EONEHANDED__AXE = 13
ETWOHANDED__AXE = 14
EONEHANDED__BLUNT = 15
ETWOHANDED__BLUNT = 16
EBOW = 17
ECROSSBOW = 18
ESTAFF = 19
EDAGGER = 20
ESHIELD = 21
'Ak'Kan Armor
ECON__BODY = 22
ECON__HEAD = 23
ECON__PELVIS = 24
ECON__PROTECT_ARM = 25
EDEX__BODY = 26
EDEX__HEAD = 27
EDEX__PELVIS = 28
EDEX__PROTECT_ARM = 29
'Ak'Kan Weapon
ECOM__BLUNT = 30
ECOM__SWORD = 31
EOPP__HAMMER = 32
EOPP__AXE = 33
EOPP__SLUSHER = 34
EOPP__TALON = 35
EOPP__SYTHE = 36
'Skillarm
ESKILL_ARM_GUARD = 37
ESKILL_ARM_ATTACK = 38
ESKILL_ARM_GUN = 39
ESKILL_ARM_KNIFE = 40
End Enum
Public Shared Function Type2String(ByVal type As base) As String
Dim s As String = type.ToString.Substring(1)
Dim k As String() = s.Split("__")
If k.Length = 2 Then
s = k(1) & "(" & k(0) & ")"
End If
Return s.Replace("_", " ")
End Function
End Class
Public Class QNationEnum
Public Enum base
EAll = 0
EKartefant = 1
EMerkhaida = 2
EGod_Pirates = 3
End Enum
Public Shared Function Type2String(ByVal type As base) As String
Return type.ToString.Substring(1).Replace("_", " ")
End Function
End Class
Public Class QTypeEnum
Public Enum base
ETalk_To_NPC = 0
EUse_Item = 1
EGo_Somewhere = 2
End Enum
Public Shared Function Type2String(ByVal type As base) As String
Return type.ToString.Substring(1).Replace("_", " ")
End Function
End Class
#End Region
End Class

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,477 @@
'################################################
'## ##
'## RYL mcf & gsf file editor ##
'## ##
'## (C) 2006 & 2007 AlphA ##
'## ##
'## This source is for private development. ##
'## You can have this source only with the ##
'## owners permission. ##
'## ##
'################################################
Public Class CScriptParser
Private iFunctions As CMcfBase.SFunction() = {}
Private iTxtLines As String() = {}
Public RYLVersion As Integer = 0
Public RYLFileType As CMcfBase.EFileType = CMcfBase.EFileType.EUnknown
Private Shared iCulture As New System.Globalization.CultureInfo("en-US")
Public Shared hexNumbers As CheckState = CheckState.Indeterminate
Public LineFeed As String = vbLf
Public Function Struct2File(ByRef functions As CMcfBase.SFunction(), ByVal fileName As String) As Boolean
Try
Struct2TXT(functions)
Dim sW As New IO.StreamWriter(fileName, False)
For Each l As String In iTxtLines
sW.WriteLine(l)
Next
sW.Close()
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
Return True
End Function
Public Sub Struct2TXT(ByRef functions As CMcfBase.SFunction())
iFunctions = functions
If iFunctions.Length < 1 Then
iTxtLines = New String() {"//////// Please Load a file in first ////////"}
Exit Sub
End If
Dim lS As New List(Of String)
lS.Add("///////////////////////////////////////")
lS.Add("//")
If RYLVersion > 0 Then lS.Add("// RYL " & RYLVersion & " " & CMcfBase.SFileType(RYLFileType) & "")
lS.Add("//")
lS.Add("////////////// Functions //////////////")
For Each f As CMcfBase.SFunction In iFunctions
If f.isExternal Then
Dim l As String = CMcfBase.DataTypeString(f.returnType) & " " & f.name & "("
If f.parameterTypes.Length > 0 Then
For Each p As CMcfBase.DataType In f.parameterTypes
l &= CMcfBase.DataTypeString(p) & ", "
Next
l = l.Substring(0, l.Length - 2)
End If
l &= ");"
lS.Add(l)
End If
Next
lS.Add("///////////////////////////////////////")
For Each f As CMcfBase.SFunction In iFunctions
If Not f.isExternal Then
If f.name <> "" Then 'Main function has no name
lS.Add("")
lS.Add("")
Dim l As String = CMcfBase.DataTypeString(f.returnType) & " " & f.name & "("
If f.parameterTypes.Length > 0 Then
For Each p As CMcfBase.DataType In f.parameterTypes
l &= CMcfBase.DataTypeString(p) & ", "
Next
l = l.Substring(0, l.Length - 2)
End If
l &= ")"
lS.Add(l)
lS.Add("{")
End If
For Each sL As CMcfBase.SScriptLine In f.data
Dim l As String = iFunctions(sL.callTo).name & "("
If sL.parameters.Length > 0 Then
For Each fp As CMcfBase.SParamElem In sL.parameters
Select Case fp.type
Case CMcfBase.DataType.EFloat
Dim tmp As Single = fp.value
l &= tmp.ToString(iCulture)
Case CMcfBase.DataType.EInteger
If hexNumbers = CheckState.Checked Then
l &= "0x" & Hex(fp.value)
ElseIf hexNumbers = CheckState.Indeterminate Then
l &= IIf(fp.value >= &HF00000, "0x" & Hex(fp.value), fp.value)
Else
l &= fp.value
End If
Case CMcfBase.DataType.EString
Dim tmp As String = fp.value
l &= ControlChars.Quote & tmp.Replace(ControlChars.Quote, "\" & ControlChars.Quote) & ControlChars.Quote
Case CMcfBase.DataType.EBool
l &= IIf(fp.value, "true", "false")
End Select
l &= ", "
Next
l = l.Substring(0, l.Length - 2)
End If
l &= ");"
lS.Add(addFormatting(l, iFunctions(sL.callTo)))
Next
If f.name <> "" Then lS.Add("}")
End If
Next
lS.Add("")
lS.Add("")
lS.Add("////////// Created on " & Now() & " by rylCoder ////////////")
iTxtLines = lS.ToArray()
End Sub
Public Function File2struct(ByVal fileName As String) As Boolean
Try
Dim sR As New IO.StreamReader(fileName)
Dim txt As String = sR.ReadToEnd
sR.Close()
TXT2struct(txt)
Catch ex As textException
MsgBox(ex.ToString & " on line " & (ex.row + 1) & " on pos " & (ex.position + 1))
Return False
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
Return True
End Function
Public Shared Function detectLineFeed(ByRef txt As String) As String
If txt.IndexOf(vbNewLine, 0) >= 0 Then
Return vbNewLine
ElseIf txt.IndexOf(vbLf, 0) >= 0 Then
Return vbLf
End If
Return vbNewLine
End Function
Public Sub TXT2struct(ByRef txt As String)
LineFeed = detectLineFeed(txt)
TXT2struct(RemoveComments(txt).Split(LineFeed), False)
End Sub
Public Sub TXT2Struct(ByVal Lines As String(), Optional ByVal ParseComments As Boolean = True)
Dim orgText As String = String.Join(LineFeed, Lines)
If ParseComments Then Lines = RemoveComments(String.Join(LineFeed, Lines)).Split(LineFeed)
Dim badChars As Char() = {vbNewLine, vbCr, vbLf, vbTab}
Dim funcs As New List(Of CMcfBase.SFunction)
Dim funcData As New List(Of List(Of CMcfBase.SScriptLine))
' Main function definition
funcs.Add(CMcfBase.CreateMainFunction())
funcData.Add(New List(Of CMcfBase.SScriptLine))
Dim ongoingFunction As Integer = 0 'default is "main"
For index As Long = 0 To Lines.Length - 1
Dim line As String = Trim(Lines(index))
If line.IndexOfAny(badChars) >= 0 Then
For Each c As Char In badChars
line = line.Replace(c, "")
Next
line = line.Trim()
End If
If line.StartsWith("{") OrElse line.EndsWith("{") Then
ongoingFunction = funcs.Count - 1 'The last function that was added to the array
line = line.Trim("{"c)
End If
If line.StartsWith("}") OrElse line.EndsWith("}") Then
ongoingFunction = 0 'Set back to main
line = line.Trim("}"c)
End If
If line <> "" Then
Dim functionFound As Boolean = False
For Each sDataType As String In CMcfBase.DataTypeString
If line.StartsWith(sDataType & " ") Then
Try
funcs.Add(line2func(line, funcs.Count))
Catch ex As textException
ex.row = index + 1
ex.overallPos = orgText.IndexOf(Lines(index))
Throw
Catch ex As Exception
Dim ex2 As New textException(ex.Message, index + 1)
ex2.overallPos = orgText.IndexOf(Lines(index))
Throw ex2
End Try
funcData.Add(New List(Of CMcfBase.SScriptLine))
functionFound = True
Exit For
End If
Next
Try
If Not functionFound Then
funcData(ongoingFunction).Add(line2struct(line, funcs))
End If
Catch ex As textException
ex.row = index + 1
ex.overallPos = orgText.IndexOf(Lines(index))
Throw
Catch ex As Exception
Dim ex2 As New textException(ex.Message, index + 1)
ex2.overallPos = orgText.IndexOf(Lines(index))
Throw ex2
End Try
End If
Next
For i As Integer = 0 To funcs.Count - 1
Dim f As CMcfBase.SFunction = funcs(i)
f.data = funcData(i).ToArray()
funcs(i) = f
Next
iTxtLines = Lines
iFunctions = funcs.ToArray()
End Sub
Public ReadOnly Property TxtLines() As String()
Get
Return iTxtLines
End Get
End Property
Public ReadOnly Property Functions() As CMcfBase.SFunction()
Get
Return iFunctions
End Get
End Property
Private Function RemoveComments(ByVal sText As String) As String
Const sStart$ = "/*", sEnd$ = "*/", sLine = "//"
Dim bIsComment As Boolean = False
Dim bInQuotes As Boolean = False
Dim lPos%, N%
Dim lastNline As Long = 0
If Len(Trim$(sText)) = 0 Then RemoveComments = vbNullString : Exit Function
For N = 1 To Len(sText)
Select Case Mid$(sText, N, 1)
Case Chr(34) 'quote
'
If Not bIsComment AndAlso ((N > 1 AndAlso bInQuotes AndAlso sText(N - 2) <> "\") OrElse (N < 2 OrElse Not bInQuotes OrElse sText(N - 3) = "\")) Then bInQuotes = Not bInQuotes
'Case "'"
' If Not (bIsComment Or bInQuotes) Then
' Mid(sText, N) = StrDup(Len(sText) - N + 1, Chr(0))
' Exit For
' End If
Case Else
Select Case Mid$(sText, N, 2)
Case sLine
If Not (bIsComment Or bInQuotes) Then
Dim deb As Boolean = False
Dim lineend As Integer = sText.IndexOf(LineFeed, N + 1)
If lineend < 0 Then lineend = sText.Length
Mid$(sText, N, lineend - N + 1) = StrDup(lineend - N + 1, Chr(0))
N = N + 1
End If
Case sStart
If Not bInQuotes Then
lPos = N
bIsComment = True
N = N + 1
End If
Case sEnd
If Not bInQuotes Then
If lPos = 0 Then lPos = 1
Mid$(sText, lPos, N + Len(sEnd) - lPos) = StrDup(N + Len(sEnd) - lPos, Chr(0))
N = N + 1
bIsComment = False
End If
Case vbNewLine
If Not bIsComment Then
If bInQuotes Then
Dim exText As String = Mid$(sText, N - 10, 20)
Dim ex As New textException(7, 0, N - lastNline - 2)
ex.overallPos = lastNline + 1
Throw ex
End If
End If
End Select
End Select
If Mid$(sText, N, LineFeed.Length) = LineFeed Then lastNline = N
Next N
If bIsComment Then
If lPos = 0 Then lPos = 1
Mid$(sText, lPos, N + Len(sEnd) - lPos) = StrDup(N + Len(sEnd) - lPos, Chr(0))
End If
RemoveComments = Replace(sText, Chr(0), "")
If Len(Trim$(RemoveComments)) Then RemoveComments = RemoveComments & LineFeed
End Function
Private Shared Function line2struct(ByVal txt As String, ByRef funcs As List(Of CMcfBase.SFunction)) As CMcfBase.SScriptLine
Dim out As New CMcfBase.SScriptLine
If txt.IndexOf("(") < 0 OrElse txt.IndexOf(");") < 0 Then Throw New textException(1, 0, txt.Length)
Dim a As String() = {txt.Substring(0, txt.IndexOf("(")), txt.Substring(txt.IndexOf("(") + 1)}
Dim b As String() = {a(1).Substring(0, a(1).LastIndexOf(");"))}
'If b(0).Length < 1 Then Throw New textException(3, a(0).Length, 0) 'cose we have Else();
' parsing parameters
Dim qIn As Boolean = False
Dim pCh As Char = Chr(0)
Dim buffer As String = ""
Dim pars As New ArrayList
For kl As Integer = 0 To b(0).Length - 1
Dim ch As Char = b(0)(kl)
If ch = ControlChars.Quote AndAlso pCh <> "\" Then
qIn = Not qIn
buffer &= ch
Else
If Not qIn AndAlso ch = "," Then
pars.Add(buffer)
buffer = ""
Else
buffer &= ch
End If
End If
pCh = ch
Next
If buffer <> "" Then pars.Add(buffer)
Dim type As Integer = -1
For i As Integer = 0 To funcs.Count - 1
If Trim(a(0)) = funcs(i).name AndAlso funcs(i).parameterTypes.Length = pars.Count Then
type = i
End If
Next
' end parsing parameters
If type < 0 Then Throw New textException(2, 0, a(0).Length)
out.callTo = type
If pars.Count > 0 Then
Dim pS(pars.Count - 1) As CMcfBase.SParamElem
Dim pos As Integer = 0
For i As Integer = 0 To pars.Count - 1
Try
pS(i) = param2elem(Trim(pars(i)), funcs(out.callTo).parameterTypes(i))
Catch ex As FormatException
Throw New textException(6, pos + a(0).Length, pars(i).Length)
Catch ex As OverflowException
Throw New textException(5, pos + a(0).Length, pars(i).Length)
End Try
pos += pars(i).length + 1
Next
out.parameters = pS
Else
out.parameters = New CMcfBase.SParamElem() {}
End If
'If pars.Count <> out.func.parameterCount Then Throw New textException(4, a(0).Length + 1, b(0).Length)
pars = Nothing
Return out
End Function
Private Shared Function param2elem(ByVal param As String, ByVal type As CMcfBase.DataType) As CMcfBase.SParamElem
Dim out As New CMcfBase.SParamElem
out.type = type
Select Case out.type
Case CMcfBase.DataType.EBool
out.value = (param = "true")
Case CMcfBase.DataType.EFloat
out.value = Single.Parse(param, iCulture)
Case CMcfBase.DataType.EInteger
If param.Length > 2 AndAlso param.Substring(0, 2) = "0x" Then
out.value = Convert.ToUInt32(param.Substring(2), 16)
Else
out.value = UInt32.Parse(param)
End If
Case CMcfBase.DataType.EString
out.value = param.Substring(1, param.Length - 2)
End Select
Return out
End Function
Private Shared Function line2func(ByVal line As String, ByVal id As Integer) As CMcfBase.SFunction
If line.IndexOf("(") < 0 OrElse line.IndexOf(")") < 0 Then Throw New textException(1, 0, line.Length)
Dim func As New CMcfBase.SFunction
Dim a As String() = line.Split("(")
Dim c As String() = a(0).Split(" ")
For i As Integer = 0 To CMcfBase.DataTypeString.Length - 1
If c(0) = CMcfBase.DataTypeString(i) Then
func.returnType = CType(i, CMcfBase.DataType)
End If
Next
func.name = c(1)
func.isExternal = (a(1).Split(")").Length > 1 AndAlso a(1).Split(")")(1) = ";")
Dim b As String() = a(1).Split(")")(0).Split(",")
Dim pS As New List(Of CMcfBase.DataType)
If b.Length > 1 OrElse b(0).Trim() <> "" Then
For i As Integer = 0 To b.Length - 1
Dim k As Integer = Array.IndexOf(CMcfBase.DataTypeString, b(i).Trim())
If k > 0 Then
pS.Add(CType(k, CMcfBase.DataType))
Else
Throw New textException(5, 0, line.Length)
End If
Next
End If
func.parameterTypes = pS.ToArray()
func.id = id
Return func
End Function
Private Function addFormatting(ByVal line As String, ByVal func As CMcfBase.SFunction) As String
Dim Ryl2QuestFunctions As String() = {"QuestSkillPointBonus", "QuestType", "QuestArea", "QuestTitle", "QuestDesc", "QuestShortDesc", "QuestIcon", "QuestCompleteSave", "QuestLevel", "QuestAward", "AddPhase", "Phase_Target", "Trigger_Start", "Trigger_Puton", "Trigger_Geton", "Trigger_Talk", "Trigger_Kill", "Trigger_Pick", "Trigger_Fame", "Trigger_LevelTalk", "Else", "Event_Disappear", "Event_Get", "Event_Spawn", "Event_MonsterDrop", "Event_Award", "Event_MsgBox", "Event_Phase", "Event_End", "Event_AwardItem", "Event_AddQuest", "Event_Move", "Event_TheaterMode"}
If RYLFileType = CMcfBase.EFileType.EQuest Then
Dim defLvl As Integer = 3
Dim lvl0 As String() = {"QuestEnd", "QuestStart"}
Dim lvl1 As String() = {"Quest", "AddPhase"}
Dim lvl2 As String() = {"Phase_", "Trigger_", "Else"}
For Each l As String In lvl0
If func.name.StartsWith(l) Then
GoTo addEnters
End If
Next
For Each l As String In lvl1
If func.name.StartsWith(l) Then
line = vbTab & line
GoTo addEnters
End If
Next
For Each l As String In lvl2
If func.name.StartsWith(l) Then
line = vbTab & vbTab & line
GoTo addEnters
End If
Next
line = vbTab & vbTab & vbTab & line
GoTo addEnters
ElseIf RYLFileType = CMcfBase.EFileType.ENpcScript Then
If func.name = "SetNPC" Then GoTo addEnters
line = vbTab & line
GoTo addEnters
End If
'Return line
addEnters:
If func.name = "SetNPC" OrElse func.name = "QuestStart" Then
line = LineFeed & LineFeed & line
ElseIf func.name = "AddPhase" Then
line = LineFeed & line
End If
Return line
End Function
End Class
Public Class textException
Inherits Exception
Public Sub New(ByVal nr As Integer, ByVal pos As Long, ByVal len As Long, Optional ByVal line As Long = 0)
code = nr
position = pos
length = len
row = line
End Sub
Public Sub New(ByVal text As String, Optional ByVal line As Long = 0)
code = &HFF
otherInf = text
row = line
End Sub
Public code As Integer
Public position As Long
Public overallPos As Long
Public length As Long
Public row As Long
Private otherInf As String
Public Overrides Function ToString() As String
Select Case code
Case 1 : Return "Non valid line. ( or ); is missing"
Case 2 : Return "Non valid line. Unknown function or incorrect parameter count"
'Case 3 : Return "Non valid line. No function parameters"
Case 4 : Return "Non valid line. Function parameter count invalid"
Case 5 : Return "Non valid line. Function parameter out of range"
Case 6 : Return "Non valid line. Function parameter is not in HEX format"
Case 7 : Return "String parameter not ended"
Case &HFF : Return otherInf
End Select
Return "Non valid script"
End Function
End Class

View File

@@ -0,0 +1,196 @@
Imports System.ComponentModel
Imports System.Drawing
Public Class CMiniMapPanel
Inherits Panel
' Fields
Private WithEvents worker As New BackgroundWorker
Public gameFld As String = ""
Private locD As Single
Private locX As Single
Private locY As Single
Public map As Bitmap = Nothing
Private mp As Panel
Private notAvailableL As Label
Private Shared npcColor As Color = Color.Violet
Private Const npcWidth As Integer = 2
Public openZone As Integer = 0
Public origArrow As Bitmap = Nothing
Private pleaseWaitL As Label
Private waitingForDraw As Boolean
Public Shadows Event Click(ByVal sender As Object, ByVal e As EventArgs)
' Nested Types
Private Structure workerArgs
Public zone As Integer
Public folder As String
Public npcs As CNpcParser.npcStruct()
Public Shared Function Create(ByVal gamefolder As String, ByVal zone As Integer, Optional ByRef npcs As CNpcParser.npcStruct() = Nothing) As workerArgs
Dim args2 As New workerArgs
args2.zone = zone
args2.folder = gamefolder
args2.npcs = npcs
Return args2
End Function
End Structure
' Methods
Public Sub New()
Me.pleaseWaitL = New Label
Me.notAvailableL = New Label
Me.waitingForDraw = False
Me.mp = New Panel
Dim size As New Size(200, 200)
Me.Size = size
Me.BorderStyle = Windows.Forms.BorderStyle.FixedSingle
Me.Visible = False
Me.mp.BackgroundImage = Nothing
Me.mp.BackColor = Color.Transparent
Me.Controls.Add(Me.mp)
Me.pleaseWaitL.AutoSize = True
Me.pleaseWaitL.Font = New Font("Comic Sans MS Bold", 18.0!, FontStyle.Italic, GraphicsUnit.Pixel)
Me.pleaseWaitL.Text = "Please wait..."
Me.pleaseWaitL.BackColor = Color.Transparent
Me.pleaseWaitL.ForeColor = Color.BlueViolet
Dim point As New Point(&H23, 40)
Me.pleaseWaitL.Location = point
Me.pleaseWaitL.Visible = False
Me.Controls.Add(Me.pleaseWaitL)
Me.notAvailableL.AutoSize = True
Me.notAvailableL.Font = New Font("Comic Sans MS Bold", 18.0!, FontStyle.Italic, GraphicsUnit.Pixel)
Me.notAvailableL.Text = "Map Not available"
Me.notAvailableL.BackColor = Color.Transparent
Me.notAvailableL.ForeColor = Color.Red
point = New Point(20, 40)
Me.notAvailableL.Location = point
Me.notAvailableL.Visible = False
Me.Controls.Add(Me.notAvailableL)
For Each c As Control In Me.Controls
AddHandler c.Click, AddressOf subClick
Next
End Sub
Private Sub subClick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Click
RaiseEvent Click(Me, e)
End Sub
Private Sub drawLoc()
Me.mp.Visible = True
Dim pnt As Point = MyPoint.Cord2Loc(New Point(Me.locX, Me.locY), Me.map.Width)
Dim img As New Bitmap(Me.Width, Me.Height, Me.map.PixelFormat)
Dim graphs As Graphics = Graphics.FromImage(img)
Dim destRect As New Rectangle(0, 0, Me.Width, Me.Height)
Dim srcRect As New Rectangle(pnt.X - Me.Height / 2, pnt.Y - Me.Height / 2, Me.Width, Me.Height)
graphs.DrawImage(Me.map, destRect, srcRect, GraphicsUnit.Pixel)
Me.BackgroundImage = img
End Sub
Public Sub drawLocation(ByVal x As Single, ByVal y As Single, ByVal dir As Single)
If openZone < 1 OrElse gameFld = String.Empty Then Return
If (((x <> Me.locX) OrElse (y <> Me.locY)) OrElse (Me.locD <> dir)) Then
If dir < 0.0! AndAlso Me.locD <> dir Then
Me.origArrow = Global.rylCoder.My.Resources.Xa_mark ' for teleports
ElseIf Me.locD <> dir Then
Try
Me.origArrow = FischR.Wrapper.LoadDDS(Me.gameFld & "\Texture\Interface\mmap01.dds", New Rectangle(&H80, &H15, &H16, &H30))
Catch ex As Exception
Me.origArrow = Global.rylCoder.My.Resources.Xa_mark
End Try
If Me.origArrow Is Nothing Then Me.origArrow = Global.rylCoder.My.Resources.Xa_mark
End If
If ((x = Me.locX) AndAlso (y = Me.locY)) Then
Me.locD = dir
Me.setRot()
Else
Me.Visible = True
Me.BackgroundImage = Nothing
Me.locX = x
Me.locY = y
If (dir <> Me.locD) Then
Me.locD = dir
Me.setRot()
End If
Me.locD = dir
If (Not Me.worker.IsBusy AndAlso (Not Me.map Is Nothing)) Then
Me.drawLoc()
ElseIf Not Me.worker.IsBusy Then
Me.notAvailableL.Visible = True
Else
Me.waitingForDraw = True
End If
End If
Else
Me.Visible = True
End If
End Sub
Public Sub openMap(ByVal gamefolder As String, ByVal zone As Integer, Optional ByRef npcs As CNpcParser.npcStruct() = Nothing)
If ((Me.map Is Nothing) OrElse (zone <> Me.openZone)) Then
Me.gameFld = gamefolder
Me.openZone = zone
If Me.worker.IsBusy Then
Me.worker = New BackgroundWorker
End If
If (Me.origArrow Is Nothing) Then
Try
Me.origArrow = FischR.Wrapper.LoadDDS(Me.gameFld & "\Texture\Interface\mmap01.dds", New Rectangle(&H80, &H15, &H16, &H30))
Catch ex As Exception
Me.origArrow = Global.rylCoder.My.Resources.Xa_mark
End Try
If Me.origArrow Is Nothing Then Me.origArrow = Global.rylCoder.My.Resources.Xa_mark
End If
Me.pleaseWaitL.Visible = True
Me.notAvailableL.Visible = False
Me.mp.Visible = False
Me.worker.RunWorkerAsync(workerArgs.Create(gamefolder, zone, (npcs)))
End If
End Sub
Private Sub setRot()
Dim num As Double = (locD / Math.PI) * 180.0!
If (num >= 360) Then num = (num - 360)
If num < 0 Then num = num + 360
Me.mp.BackgroundImage = Support.Imaging.RotateImage(Me.origArrow, num)
Me.mp.Size = Me.mp.BackgroundImage.Size
Dim point As New Point(CInt(Math.Round(CDbl(((CDbl(Me.Width) / 2) - (CDbl(Me.mp.Width) / 2))))), CInt(Math.Round(CDbl(((CDbl(Me.Height) / 2) - (CDbl(Me.mp.Height) / 2))))))
Me.mp.Location = point
End Sub
Private Sub worker_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles worker.DoWork
Dim wk As workerArgs = e.Argument
Dim bmp As Bitmap = CMiniMap.CreateMap(wk.folder, wk.zone)
If Not wk.npcs Is Nothing AndAlso Not bmp Is Nothing Then
For Each npc As CNpcParser.npcStruct In wk.npcs
Dim npcPosLines As CNpcParser.NPCline() = npc.Lines(CNpcParser.NPCline.knownType.ESetPosition)
If npc.Map > 0 AndAlso npc.Map = wk.zone Then
Dim cord As New Point(npcPosLines(0).Params(2).value, npcPosLines(0).Params(4).value)
Dim loc As Point = MyPoint.Cord2Loc(cord, bmp.Width)
For i As Integer = loc.X - npcWidth / 2 To loc.X + npcWidth / 2
For j As Integer = loc.Y - npcWidth / 2 To loc.Y + npcWidth / 2
If i >= 0 AndAlso j >= 0 AndAlso i < bmp.Width AndAlso j < bmp.Height Then
bmp.SetPixel(i, j, CMiniMapPanel.npcColor)
End If
Next
Next
End If
Next
End If
e.Result = bmp
End Sub
Private Sub worker_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs) Handles worker.RunWorkerCompleted
Me.map = e.Result
Me.pleaseWaitL.Visible = False
If Me.waitingForDraw Then
If Not Me.map Is Nothing Then
Me.drawLoc()
Else
Me.notAvailableL.Visible = True
End If
End If
End Sub
End Class

View File

@@ -0,0 +1,47 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class cntQuestPhaseLine
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.flowMain = New System.Windows.Forms.FlowLayoutPanel
Me.SuspendLayout()
'
'flowMain
'
Me.flowMain.Location = New System.Drawing.Point(0, 0)
Me.flowMain.Name = "flowMain"
Me.flowMain.Size = New System.Drawing.Size(279, 21)
Me.flowMain.TabIndex = 0
Me.flowMain.WrapContents = False
'
'cntQuestPhaseLine
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.flowMain)
Me.DoubleBuffered = True
Me.Margin = New System.Windows.Forms.Padding(0)
Me.Name = "cntQuestPhaseLine"
Me.Size = New System.Drawing.Size(282, 21)
Me.ResumeLayout(False)
End Sub
Friend WithEvents flowMain As System.Windows.Forms.FlowLayoutPanel
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,82 @@
Public Class cntQuestPhaseLine
Public qLine As CQuestParser.QLine = Nothing
Public level As Integer = 0
Private lvl3BG As Color = Color.FromArgb(&HFFFFE9E9)
Private lvl3BGa As Color = Color.FromArgb(&HFFFFBBBB)
Private lvl4BG As Color = Color.FromArgb(&HFFE9FFE9)
Private lvl4BGa As Color = Color.FromArgb(&HFFBBFFBB)
Private mouseIsDown As Boolean = False
Public Event openQLinesForEdit(ByRef sender As cntQuestPhaseLine, ByRef line As CQuestParser.QLine)
Public Event lineWantsToMove(ByRef sender As cntQuestPhaseLine, ByRef line As CQuestParser.QLine, ByVal offset As Integer)
Private butDownLocation As Integer = 0
Public Sub New()
InitializeComponent()
End Sub
Public Sub New(ByRef line As CQuestParser.QLine)
InitializeComponent()
setQuestLine(line)
End Sub
Public Sub setQuestLine(ByRef line As CQuestParser.QLine)
qLine = line
level = IIf(Array.IndexOf(CQuestParser.QuestPhase.lvl3functions, qLine.Type) >= 0, 3, 4)
If qLine.Type = CQuestParser.QLine.KnownType.EElse Then level = 3
Me.BackColor = IIf(level = 3, lvl3BG, lvl4BG)
Me.flowMain.Controls.Add(New frmNpcEdit.namedLabel(IIf(level <> 3, StrDup(3, " "), "") & CQuestParser.QLine.Type2String(qLine.Type) & "(", True))
Dim i As Integer = 0
For Each p As CMcfBase.SParamElem In qLine.params
Me.flowMain.Controls.Add(New frmNpcEdit.namedLabel(p.value.ToString & IIf(i < qLine.params.Length - 1, ",", "")))
i += 1
Next
Me.flowMain.Controls.Add(New frmNpcEdit.namedLabel(")", True))
setHooks()
End Sub
Private Sub cntQuestPhaseLine_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
setHooks()
End Sub
Private Sub cntQuestPhaseLine_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
RaiseEvent openQLinesForEdit(Me, qLine)
End Sub
Private Sub cntQuestPhaseLine_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
Me.BackColor = IIf(level = 3, lvl3BGa, lvl4BGa)
End Sub
Private Sub cntQuestPhaseLine_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseLeave
Me.BackColor = IIf(level = 3, lvl3BG, lvl4BG)
End Sub
Private Sub setHooks(Optional ByVal cntCollec As Windows.Forms.Control.ControlCollection = Nothing)
If cntCollec Is Nothing Then cntCollec = Me.Controls
For Each c As Control In cntCollec
AddHandler c.MouseEnter, AddressOf cntQuestPhaseLine_MouseEnter
AddHandler c.MouseLeave, AddressOf cntQuestPhaseLine_MouseLeave
AddHandler c.MouseClick, AddressOf cntQuestPhaseLine_MouseClick
AddHandler c.MouseDown, AddressOf cntQuestPhaseLine_MouseDown
AddHandler c.MouseUp, AddressOf cntQuestPhaseLine_MouseUp
AddHandler c.MouseMove, AddressOf cntQuestPhaseLine_MouseMove
If Not c.Controls Is Nothing AndAlso c.Controls.Count > 0 Then
setHooks(c.Controls)
End If
Next
End Sub
Private Sub cntQuestPhaseLine_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
mouseIsDown = True
butDownLocation = e.Location.Y
End Sub
Private Sub cntQuestPhaseLine_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
If mouseIsDown Then
Me.Cursor = Cursors.Default
Dim offDiff As Integer = e.Location.Y - butDownLocation
If offDiff > 5 OrElse offDiff < -5 Then RaiseEvent lineWantsToMove(Me, qLine, offDiff + Me.Location.Y)
End If
mouseIsDown = False
End Sub
Private Sub cntQuestPhaseLine_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
If mouseIsDown Then
Me.Cursor = Cursors.SizeAll
End If
End Sub
End Class

View File

@@ -0,0 +1,141 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class cntQuestPhaseLineEditor
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.lblFuncDesc = New System.Windows.Forms.Label
Me.lnkClose = New System.Windows.Forms.LinkLabel
Me.lnkSave = New System.Windows.Forms.LinkLabel
Me.flowParas = New System.Windows.Forms.FlowLayoutPanel
Me.cmbFunction = New System.Windows.Forms.ComboBox
Me.Label1 = New System.Windows.Forms.Label
Me.lnkDelete = New System.Windows.Forms.LinkLabel
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.lnkDelete)
Me.GroupBox1.Controls.Add(Me.lblFuncDesc)
Me.GroupBox1.Controls.Add(Me.lnkClose)
Me.GroupBox1.Controls.Add(Me.lnkSave)
Me.GroupBox1.Controls.Add(Me.flowParas)
Me.GroupBox1.Controls.Add(Me.cmbFunction)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.GroupBox1.ForeColor = System.Drawing.SystemColors.ControlText
Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(289, 373)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Quest Phase Line Editor"
'
'lblFuncDesc
'
Me.lblFuncDesc.AutoEllipsis = True
Me.lblFuncDesc.AutoSize = True
Me.lblFuncDesc.Location = New System.Drawing.Point(6, 45)
Me.lblFuncDesc.Name = "lblFuncDesc"
Me.lblFuncDesc.Size = New System.Drawing.Size(102, 13)
Me.lblFuncDesc.TabIndex = 5
Me.lblFuncDesc.Text = "Function description"
Me.lblFuncDesc.UseMnemonic = False
'
'lnkClose
'
Me.lnkClose.AutoSize = True
Me.lnkClose.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(186, Byte))
Me.lnkClose.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline
Me.lnkClose.Location = New System.Drawing.Point(274, 0)
Me.lnkClose.Name = "lnkClose"
Me.lnkClose.Size = New System.Drawing.Size(15, 13)
Me.lnkClose.TabIndex = 4
Me.lnkClose.TabStop = True
Me.lnkClose.Text = "X"
'
'lnkSave
'
Me.lnkSave.AutoSize = True
Me.lnkSave.Location = New System.Drawing.Point(250, 351)
Me.lnkSave.Name = "lnkSave"
Me.lnkSave.Size = New System.Drawing.Size(32, 13)
Me.lnkSave.TabIndex = 3
Me.lnkSave.TabStop = True
Me.lnkSave.Text = "Save"
'
'flowParas
'
Me.flowParas.AutoScroll = True
Me.flowParas.Location = New System.Drawing.Point(3, 72)
Me.flowParas.Name = "flowParas"
Me.flowParas.Size = New System.Drawing.Size(279, 276)
Me.flowParas.TabIndex = 2
'
'cmbFunction
'
Me.cmbFunction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cmbFunction.FormattingEnabled = True
Me.cmbFunction.Location = New System.Drawing.Point(63, 21)
Me.cmbFunction.Name = "cmbFunction"
Me.cmbFunction.Size = New System.Drawing.Size(220, 21)
Me.cmbFunction.TabIndex = 1
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(51, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Function:"
'
'lnkDelete
'
Me.lnkDelete.AutoSize = True
Me.lnkDelete.Location = New System.Drawing.Point(190, 351)
Me.lnkDelete.Name = "lnkDelete"
Me.lnkDelete.Size = New System.Drawing.Size(38, 13)
Me.lnkDelete.TabIndex = 6
Me.lnkDelete.TabStop = True
Me.lnkDelete.Text = "Delete"
'
'cntQuestPhaseLineEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.GroupBox1)
Me.Name = "cntQuestPhaseLineEditor"
Me.Size = New System.Drawing.Size(290, 376)
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents cmbFunction As System.Windows.Forms.ComboBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents flowParas As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents lnkClose As System.Windows.Forms.LinkLabel
Friend WithEvents lnkSave As System.Windows.Forms.LinkLabel
Friend WithEvents lblFuncDesc As System.Windows.Forms.Label
Friend WithEvents lnkDelete As System.Windows.Forms.LinkLabel
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,204 @@
Public Class cntQuestPhaseLineEditor
Public line As CQuestParser.QLine = Nothing
Public level As Integer = 0
Private iSyntax As Xml.XmlElement = Nothing
Public Event Save(ByRef sender As cntQuestPhaseLineEditor, ByRef line As CQuestParser.QLine)
Public Event Close(ByRef sender As cntQuestPhaseLineEditor)
Public Event Delete(ByRef sender As cntQuestPhaseLineEditor, ByRef line As CQuestParser.QLine)
Public Event NeedItemName(ByRef sender As cntQuestPhaseLineEditor, ByVal id As Long, ByRef name As String)
Public Event NeedItemSelect(ByRef sender As cntQuestPhaseLineEditor, ByRef sender2 As LinkLabel)
Public Event NeedMobName(ByRef sender As cntQuestPhaseLineEditor, ByVal id As Long, ByRef name As String)
Public Event NeedMobSelect(ByRef sender As cntQuestPhaseLineEditor, ByRef sender2 As LinkLabel)
Private currentParaCount As Integer = 0
Private currentF As CQuestParser.QLine.KnownType
Public Sub New(ByRef qLine As CQuestParser.QLine, ByVal syntax As Xml.XmlElement)
line = qLine
iSyntax = syntax
' This call is required by the Windows Form Designer.
InitializeComponent()
Dim funcs() As CQuestParser.QLine.KnownType = {}
If Array.IndexOf(CQuestParser.QuestPhase.lvl3functions, line.Type) >= 0 Then level = 3
If Array.IndexOf(CQuestParser.QuestPhase.lvl4functions, line.Type) >= 0 Then level = 4
If level < 1 Then Exit Sub
If level = 3 Then funcs = CQuestParser.QuestPhase.lvl3functions
If level = 4 Then funcs = CQuestParser.QuestPhase.lvl4functions
' Add any initialization after the InitializeComponent() call.
For Each e As CQuestParser.QLine.KnownType In funcs
Me.cmbFunction.Items.Add(New frmNpcEdit.cmbItem(e, CQuestParser.QLine.Type2String(e)))
Next
End Sub
Private Sub drawProps(ByVal func As CQuestParser.QLine.KnownType)
Me.flowParas.SuspendLayout()
Me.flowParas.Controls.Clear()
Me.lblFuncDesc.Text = ""
If Not iSyntax Is Nothing Then
Dim fNodes As Xml.XmlNodeList = iSyntax.SelectNodes("func[@name='" & CQuestParser.QLine.Type2String(func) & "' and @level=" & level & "]")
If fNodes.Count = 1 Then
Me.lblFuncDesc.Text = fNodes(0).Attributes.GetNamedItem("desc").Value
currentParaCount = fNodes(0).ChildNodes.Count
currentF = func
If fNodes(0).ChildNodes.Count > 0 Then
Dim i As Integer = 0
For Each pNode As Xml.XmlNode In fNodes(0).ChildNodes
Dim type As String = pNode.Attributes.GetNamedItem("type").Value
Dim name As String = pNode.Attributes.GetNamedItem("name").Value
Dim desc As String = pNode.Attributes.GetNamedItem("desc").Value
Dim txtI As New CNpcParser.NPCTextItem
txtI.paraIndex = i
Select Case type
Case "int"
txtI.Tag = CMcfBase.DataType.EInteger
If line.Type <> func Then txtI.text = "0"
Case "string"
txtI.Tag = CMcfBase.DataType.EString
If line.Type <> func Then txtI.text = New String("")
Case "float"
txtI.Tag = CMcfBase.DataType.EFloat
If line.Type <> func Then txtI.text = "0"
Case "bool"
txtI.Tag = CMcfBase.DataType.EBool
If line.Type <> func Then txtI.text = "0"
End Select
If line.Type = func Then
txtI.text = line.params(i).value
End If
If type = "int" AndAlso name.ToLower = "item id" Then
Dim lbl As New Label
lbl.Width = Me.flowParas.Width - 6
lbl.Text = IIf(name.ToLower <> desc.ToLower, "[" & name & "] ", "") & desc
lbl.Margin = New Padding(3, 0, 3, 0)
Me.flowParas.Controls.Add(lbl)
Dim obj As New LinkLabel
Dim itemName As String = ""
Dim itemId As Long = IIf(txtI.text.Length > 0, txtI.text, 0)
RaiseEvent NeedItemName(Me, itemId, itemName)
obj.Text = "Item: " & IIf(itemId > 0, itemName, "none")
obj.Tag = txtI
obj.Width = Me.flowParas.Width - 6
obj.Margin = New Padding(3, 0, 3, 3)
AddHandler obj.LinkClicked, AddressOf linkParam_Click
Me.flowParas.Controls.Add(obj)
ElseIf type = "int" AndAlso name.ToLower = "monster id" Then
Dim lbl As New Label
lbl.Width = Me.flowParas.Width - 6
lbl.Text = IIf(name.ToLower <> desc.ToLower, "[" & name & "] ", "") & desc
lbl.Margin = New Padding(3, 0, 3, 0)
Me.flowParas.Controls.Add(lbl)
Dim obj As New LinkLabel
Dim itemName As String = ""
Dim mobId As Long = IIf(txtI.text.Length > 0, txtI.text, 0)
RaiseEvent NeedMobName(Me, mobId, itemName)
obj.Text = "Mob: " & IIf(mobId > 0, itemName, "none")
obj.Tag = txtI
obj.Width = Me.flowParas.Width - 6
obj.Margin = New Padding(3, 0, 3, 3)
AddHandler obj.LinkClicked, AddressOf linkParam2_Click
Me.flowParas.Controls.Add(obj)
Else
Dim obj As New cntTextEditItem()
AddHandler obj.NPCTextChanged, AddressOf TxtItem_NPCTextChanged
Dim wDiff As Integer = obj.Width - obj.txtText.Width
obj.Width = Me.flowParas.Width - 6
obj.txtText.Width = obj.Width - wDiff
If type <> "string" Then
obj.Small = True
End If
If type = "int" AndAlso (name.ToLower = "quest id" OrElse name.ToLower = "npc id" OrElse desc.ToLower = "npc id") Then
txtI.text = "0x" & Hex(Val(txtI.text))
End If
obj.TextItem = txtI
obj.Tag = txtI
obj.Command = IIf(name.ToLower <> desc.ToLower, "[" & name & "] ", "") & desc
Me.flowParas.Controls.Add(obj)
End If
i += 1
Next
Else
Me.flowParas.Controls.Add(New frmNpcEdit.namedLabel("Function has no parameters", True))
End If
Me.lnkSave.Enabled = True
Else
Me.lnkSave.Enabled = False
Me.flowParas.Controls.Add(New frmNpcEdit.namedLabel("Function not found in Syntax XML", True))
End If
Else
Me.lnkSave.Enabled = False
Me.flowParas.Controls.Add(New frmNpcEdit.namedLabel("Syntax XML not loaded", True))
End If
Me.flowParas.ResumeLayout()
End Sub
Private Sub linkParam_Click(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs)
RaiseEvent NeedItemSelect(Me, sender)
Dim nName As String = ""
If Val(sender.tag.text) > 0 Then
RaiseEvent NeedItemName(Me, sender.tag.text, nName)
sender.text = "Item: " & nName
Else
sender.Text = "Item: none"
End If
End Sub
Private Sub linkParam2_Click(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs)
RaiseEvent NeedMobSelect(Me, sender)
Dim nName As String = ""
If Val(sender.tag.text) > 0 Then
RaiseEvent NeedMobName(Me, sender.tag.text, nName)
sender.text = "Mob: " & nName
Else
sender.Text = "Mob: none"
End If
End Sub
Private Sub lnkClose_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkClose.LinkClicked
RaiseEvent Close(Me)
End Sub
Private Sub lnkSave_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkSave.LinkClicked
Dim paraList(currentParaCount - 1) As CMcfBase.SParamElem
Dim i As Integer = 0
For Each c As Control In Me.flowParas.Controls
If Not c.Tag Is Nothing Then
Dim val As Object = Nothing
Dim tI As CNpcParser.NPCTextItem = CType(c.Tag, CNpcParser.NPCTextItem)
Try
Select Case CType(tI.Tag, CMcfBase.DataType)
Case CMcfBase.DataType.EBool : val = IIf(val(tI.text) > 0, 1, 0)
Case CMcfBase.DataType.EFloat : val = Single.Parse(tI.text)
Case CMcfBase.DataType.EInteger
If tI.text.Length > 2 AndAlso tI.text.Substring(0, 2).ToLower = "0x" Then
val = Convert.ToUInt32(tI.text, 16)
Else
val = UInt32.Parse(tI.text)
End If
Case CMcfBase.DataType.EString : val = tI.text
End Select
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Save error on " & (i + 1) & "'th parameter")
Exit Sub
End Try
paraList(i) = CMcfBase.CreateParamElem(CType(tI.Tag, CMcfBase.DataType), val)
i += 1
End If
Next
line.Type = currentF
line.params = paraList
RaiseEvent Save(Me, line)
End Sub
Private Sub lnkDelete_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkDelete.LinkClicked
RaiseEvent Delete(Me, line)
End Sub
Private Sub cmbFunction_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbFunction.SelectedIndexChanged
drawProps(CType(cmbFunction.SelectedItem, frmNpcEdit.cmbItem).iItem)
End Sub
Private Sub cntQuestPhaseLineEditor_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
frmNpcEdit.cmbItem.setComboSelected(Me.cmbFunction, line.Type)
End Sub
Private Sub TxtItem_NPCTextChanged(ByRef sender As cntTextEditItem, ByVal line As CNpcParser.NPCTextItem, ByVal newText As String)
line.text = newText
sender.Tag = line
End Sub
End Class

View File

@@ -0,0 +1,153 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class cntShopView
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.cntMnuNPCItem = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.mnuNPCItemsAdd = New System.Windows.Forms.ToolStripMenuItem
Me.mnuNPCItemsEdit = New System.Windows.Forms.ToolStripMenuItem
Me.mnuNPCItemsDelete = New System.Windows.Forms.ToolStripMenuItem
Me.lstSoldItems = New System.Windows.Forms.ListBox
Me.tipItems = New System.Windows.Forms.ToolTip(Me.components)
Me.cntMnuNPCItemEdit = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem
Me.cntMnuItemAdd = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ToolStripMenuItem4 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem5 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem6 = New System.Windows.Forms.ToolStripMenuItem
Me.cntMnuNPCItemEdit.SuspendLayout()
Me.cntMnuItemAdd.SuspendLayout()
Me.SuspendLayout()
'
'cntMnuNPCItem
'
Me.cntMnuNPCItem.Name = "cntMnuNPCItem"
Me.cntMnuNPCItem.Size = New System.Drawing.Size(117, 70)
'
'mnuNPCItemsAdd
'
Me.mnuNPCItemsAdd.Name = "mnuNPCItemsAdd"
Me.mnuNPCItemsAdd.Size = New System.Drawing.Size(152, 22)
Me.mnuNPCItemsAdd.Text = "&Add"
'
'mnuNPCItemsEdit
'
Me.mnuNPCItemsEdit.Name = "mnuNPCItemsEdit"
Me.mnuNPCItemsEdit.Size = New System.Drawing.Size(116, 22)
Me.mnuNPCItemsEdit.Text = "&Edit"
'
'mnuNPCItemsDelete
'
Me.mnuNPCItemsDelete.Name = "mnuNPCItemsDelete"
Me.mnuNPCItemsDelete.Size = New System.Drawing.Size(116, 22)
Me.mnuNPCItemsDelete.Text = "&Delete"
'
'lstSoldItems
'
Me.lstSoldItems.ContextMenuStrip = Me.cntMnuNPCItem
Me.lstSoldItems.FormattingEnabled = True
Me.lstSoldItems.Location = New System.Drawing.Point(0, 0)
Me.lstSoldItems.Name = "lstSoldItems"
Me.lstSoldItems.Size = New System.Drawing.Size(290, 316)
Me.lstSoldItems.TabIndex = 3
'
'tipItems
'
Me.tipItems.AutoPopDelay = 20000
Me.tipItems.InitialDelay = 500
Me.tipItems.IsBalloon = True
Me.tipItems.ReshowDelay = 100
Me.tipItems.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
Me.tipItems.ToolTipTitle = "Info"
'
'cntMnuNPCItemEdit
'
Me.cntMnuNPCItemEdit.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuNPCItemsEdit, Me.mnuNPCItemsDelete})
Me.cntMnuNPCItemEdit.Name = "cntMnuNPCItem"
Me.cntMnuNPCItemEdit.Size = New System.Drawing.Size(117, 48)
'
'ToolStripMenuItem1
'
Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1"
Me.ToolStripMenuItem1.Size = New System.Drawing.Size(32, 19)
'
'ToolStripMenuItem2
'
Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2"
Me.ToolStripMenuItem2.Size = New System.Drawing.Size(32, 19)
'
'ToolStripMenuItem3
'
Me.ToolStripMenuItem3.Name = "ToolStripMenuItem3"
Me.ToolStripMenuItem3.Size = New System.Drawing.Size(32, 19)
'
'cntMnuItemAdd
'
Me.cntMnuItemAdd.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuNPCItemsAdd})
Me.cntMnuItemAdd.Name = "cntMnuNPCItem"
Me.cntMnuItemAdd.Size = New System.Drawing.Size(153, 48)
'
'ToolStripMenuItem4
'
Me.ToolStripMenuItem4.Name = "ToolStripMenuItem4"
Me.ToolStripMenuItem4.Size = New System.Drawing.Size(32, 19)
'
'ToolStripMenuItem5
'
Me.ToolStripMenuItem5.Name = "ToolStripMenuItem5"
Me.ToolStripMenuItem5.Size = New System.Drawing.Size(32, 19)
'
'ToolStripMenuItem6
'
Me.ToolStripMenuItem6.Name = "ToolStripMenuItem6"
Me.ToolStripMenuItem6.Size = New System.Drawing.Size(32, 19)
'
'cntShopView
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackgroundImage = Global.rylCoder.My.Resources.Resources.npcShopBg
Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
Me.Controls.Add(Me.lstSoldItems)
Me.Name = "cntShopView"
Me.Size = New System.Drawing.Size(290, 313)
Me.cntMnuNPCItemEdit.ResumeLayout(False)
Me.cntMnuItemAdd.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents cntMnuNPCItem As System.Windows.Forms.ContextMenuStrip
Friend WithEvents mnuNPCItemsAdd As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mnuNPCItemsEdit As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mnuNPCItemsDelete As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents lstSoldItems As System.Windows.Forms.ListBox
Friend WithEvents tipItems As System.Windows.Forms.ToolTip
Friend WithEvents cntMnuNPCItemEdit As System.Windows.Forms.ContextMenuStrip
Friend WithEvents ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem2 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem3 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cntMnuItemAdd As System.Windows.Forms.ContextMenuStrip
Friend WithEvents ToolStripMenuItem4 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem5 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem6 As System.Windows.Forms.ToolStripMenuItem
End Class

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="cntMnuNPCItem.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tipItems.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>149, 17</value>
</metadata>
<metadata name="cntMnuNPCItemEdit.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>241, 17</value>
</metadata>
<metadata name="cntMnuItemAdd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>392, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,195 @@
Public Class cntShopView
Private gridView As Boolean = False
Private images As New List(Of PictureBox)
Private imageSlots(,) As Integer
Private iSelect As frmSelectItem = Nothing
Private Const NUM_SLOTS_HORI = 8
Private Const NUM_SLOTS_VERT = 12
Private Const WIDTH_SEPERATOR = 1
Private Const WIDTH_SLOT = 25
Private Const HEIGHT_SLOT = 25
Public Event AddItemRequest(ByVal sender As Object, ByVal e As System.EventArgs)
Public Event EditItemRequest(ByVal sender As Object, ByVal e As System.EventArgs)
Public Event DeleteRequest(ByVal sender As Object, ByVal e As System.EventArgs)
Public Event MenuOpening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Public Sub updateForm(ByVal selector As frmSelectItem)
iSelect = selector
If frmNpcEdit.RylGameDir <> "" AndAlso Not selector Is Nothing Then
gridView = True
Me.lstSoldItems.Visible = False
Me.Size = Me.BackgroundImage.Size
imageSlots = New Integer(NUM_SLOTS_VERT, NUM_SLOTS_HORI) {}
Me.Location += New Point((Me.lstSoldItems.Width - Me.BackgroundImage.Width) / 2, 0)
Me.ContextMenuStrip = cntMnuItemAdd
Else
Me.lstSoldItems.Visible = True
Me.Size = Me.lstSoldItems.Size
End If
End Sub
Private Function newItemLocation(ByVal imgSlots As Size, ByVal itemID As Integer) As Point
Dim tmpSlots(NUM_SLOTS_VERT - 1)() As Boolean
For y As Integer = 0 To NUM_SLOTS_VERT - 1
For x As Integer = 0 To NUM_SLOTS_HORI - 1
Dim id As Integer = imageSlots(y, x)
If id < 1 AndAlso y + imgSlots.Height <= NUM_SLOTS_VERT AndAlso x + imgSlots.Width <= NUM_SLOTS_HORI Then
Dim gotRoom As Boolean = True
For y2 As Integer = y To y + imgSlots.Height - 1
For x2 As Integer = x To x + imgSlots.Width - 1
If gotRoom AndAlso imageSlots(y2, x2) > 0 Then gotRoom = False
Next
Next
If gotRoom Then
For y2 As Integer = y To y + imgSlots.Height - 1
For x2 As Integer = x To x + imgSlots.Width - 1
imageSlots(y2, x2) = itemID
Next
Next
Return New Point(x * (WIDTH_SEPERATOR + WIDTH_SLOT) + WIDTH_SEPERATOR, y * (WIDTH_SEPERATOR + HEIGHT_SLOT) + WIDTH_SEPERATOR)
End If
End If
Next
Next
Return New Point(-1, -1)
End Function
Public Sub AddItem(ByVal item As frmNpcEdit.ShopItem)
Me.lstSoldItems.Items.Add(item)
If gridView Then
Dim gItem As frmSelectItem.GameItem = iSelect.getGameItem(item.itemId)
Dim slots As New Size(1, 1)
Dim img As Bitmap = Nothing
If gItem.ID > 0 Then
img = frmSelectItem.bitmapForItem(gItem)
slots = New Point(gItem.slotsX, gItem.slotsY)
End If
If img Is Nothing Then img = Global.rylCoder.My.Resources.npcShopNotFound
Dim loc As Point = newItemLocation(slots, item.itemId)
If loc.X >= 0 AndAlso loc.Y >= 0 Then
img.MakeTransparent(Color.Black)
Dim pB As New PictureBox()
pB.Tag = New imageItemTag(item, Me.lstSoldItems.Items.Count - 1)
pB.BackColor = Color.Transparent
pB.Image = img
pB.Size = New Size(slots.Width * WIDTH_SLOT + (slots.Width - 1) * WIDTH_SEPERATOR, slots.Height * HEIGHT_SLOT + (slots.Height - 1) * WIDTH_SEPERATOR)
pB.Location = loc
Me.Controls.Add(pB)
images.Add(pB)
pB.ContextMenuStrip = cntMnuNPCItemEdit
AddHandler pB.MouseDown, AddressOf imageItem_Click
AddHandler pB.MouseDoubleClick, AddressOf imageItem_DoubleClick
tipItems.SetToolTip(pB, item.ToString())
End If
End If
End Sub
Public Function IndexOnList(ByVal itemID As Integer) As Integer
Dim k As Integer = 0
For Each item As frmNpcEdit.ShopItem In Me.lstSoldItems.Items
If item.itemId = itemID Then Return k
k += 1
Next
Return -1
End Function
Public Sub ClearShop()
Me.lstSoldItems.Items.Clear()
If gridView Then
Me.BackgroundImage = Global.rylCoder.My.Resources.npcShopBg
tipItems.RemoveAll()
imageSlots = New Integer(NUM_SLOTS_VERT, NUM_SLOTS_HORI) {}
For Each cnt As Control In images
Me.Controls.Remove(cnt)
cnt.Dispose()
Next
images = New List(Of PictureBox)
End If
End Sub
Public Property SelectedIndex() As Integer
Get
Return Me.lstSoldItems.SelectedIndex
End Get
Set(ByVal value As Integer)
If value >= 0 AndAlso value <= Me.lstSoldItems.Items.Count Then
Me.lstSoldItems.SelectedIndex = value
activateImageItem(images(value))
End If
End Set
End Property
Public ReadOnly Property SelectedItem() As frmNpcEdit.ShopItem
Get
Dim i As Integer = SelectedIndex
If i >= 0 AndAlso i < Me.lstSoldItems.Items.Count Then
Return Me.lstSoldItems.Items(i)
Else
Return Nothing
End If
End Get
End Property
Public ReadOnly Property Count() As Integer
Get
Return Me.lstSoldItems.Items.Count
End Get
End Property
Public Property Items(ByVal index As Integer) As frmNpcEdit.ShopItem
Get
Return Me.lstSoldItems.Items(index)
End Get
Set(ByVal value As frmNpcEdit.ShopItem)
Me.lstSoldItems.Items(index) = value
End Set
End Property
Private Sub mnuNPCItemsAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuNPCItemsAdd.Click
RaiseEvent AddItemRequest(Me.mnuNPCItemsAdd, New EventArgs)
End Sub
Private Sub mnuNPCItemsDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuNPCItemsDelete.Click
RaiseEvent DeleteRequest(Me.mnuNPCItemsDelete, New EventArgs)
End Sub
Private Sub mnuNPCItemsEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuNPCItemsEdit.Click
RaiseEvent EditItemRequest(Me.mnuNPCItemsEdit, New EventArgs)
End Sub
Private Sub cntMnuNPCItem_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cntMnuNPCItem.Opening
RaiseEvent MenuOpening(Me.cntMnuNPCItem, e)
End Sub
Private Sub imageItem_Click(ByVal sender As Object, ByVal e As MouseEventArgs)
activateImageItem(CType(sender, PictureBox))
End Sub
Private Sub imageItem_DoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs)
activateImageItem(sender)
RaiseEvent EditItemRequest(sender, New EventArgs)
End Sub
Private Sub activateImageItem(ByVal imgItem As PictureBox)
Dim tag As imageItemTag = CType(imgItem.Tag, imageItemTag)
Me.BackgroundImage = Global.rylCoder.My.Resources.npcShopBg
For Each picBox As PictureBox In images
Dim pTag As imageItemTag = CType(picBox.Tag, imageItemTag)
If pTag.activated Then
pTag.activated = False
picBox.Tag = pTag
End If
Next
tag.activated = True
imgItem.Tag = tag
Me.lstSoldItems.SelectedIndex = tag.index
Dim gr As Graphics = Graphics.FromImage(Me.BackgroundImage)
gr.DrawRectangle(Pens.BlueViolet, imgItem.Location.X, imgItem.Location.Y, imgItem.Width - 1, imgItem.Height - 1)
gr.Flush()
imgItem.Refresh()
End Sub
Private Structure imageItemTag
Public sItem As frmNpcEdit.ShopItem
Public activated As Boolean
Public index As Integer
Public Sub New(ByVal item As frmNpcEdit.ShopItem, ByVal i As Integer)
sItem = item
index = i
activated = False
End Sub
End Structure
End Class

View File

@@ -0,0 +1,61 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class cntTextEditItem
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lblCommand = New System.Windows.Forms.Label
Me.txtText = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'lblCommand
'
Me.lblCommand.AutoSize = True
Me.lblCommand.Location = New System.Drawing.Point(0, -1)
Me.lblCommand.Name = "lblCommand"
Me.lblCommand.Size = New System.Drawing.Size(74, 13)
Me.lblCommand.TabIndex = 0
Me.lblCommand.Text = "Command row"
'
'txtText
'
Me.txtText.AcceptsReturn = True
Me.txtText.Location = New System.Drawing.Point(0, 15)
Me.txtText.Multiline = True
Me.txtText.Name = "txtText"
Me.txtText.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.txtText.Size = New System.Drawing.Size(324, 113)
Me.txtText.TabIndex = 1
Me.txtText.WordWrap = False
'
'cntTextEditItem
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.txtText)
Me.Controls.Add(Me.lblCommand)
Me.Name = "cntTextEditItem"
Me.Size = New System.Drawing.Size(327, 145)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lblCommand As System.Windows.Forms.Label
Public WithEvents txtText As System.Windows.Forms.TextBox
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,54 @@
Public Class cntTextEditItem
Private iTextitem As CNpcParser.NPCTextItem
Public Event NPCTextChanged(ByRef sender As cntTextEditItem, ByVal line As CNpcParser.NPCTextItem, ByVal newText As String)
Public Property NPCText() As String
Get
If Me.txtText.Lines.Length > 0 Then
Dim lines() As String = Me.txtText.Lines
If Trim(lines(UBound(lines))) = vbNewLine Then Array.Resize(lines, lines.Length - 1)
Return String.Join("\\", lines)
Else
Return ""
End If
End Get
Set(ByVal value As String)
Dim lines() As String = value.Split(New String() {"\\"}, StringSplitOptions.None)
Me.txtText.Lines = lines
End Set
End Property
Public Property Command() As String
Get
Return Me.lblCommand.Text
End Get
Set(ByVal value As String)
Me.lblCommand.Text = Trim(value)
End Set
End Property
Public Property TextItem() As CNpcParser.NPCTextItem
Get
Return iTextitem
End Get
Set(ByVal value As CNpcParser.NPCTextItem)
NPCText() = value.text
iTextitem = value
End Set
End Property
Public Property Small() As Boolean
Get
Return Not Me.txtText.Multiline
End Get
Set(ByVal value As Boolean)
If value Then
Dim txtheight As Integer = Me.txtText.Size.Height
Me.txtText.Multiline = False
Me.txtText.ScrollBars = ScrollBars.None
Me.Size = New Size(Me.Size.Width, Me.Size.Height - (txtheight - Me.txtText.Size.Height))
End If
End Set
End Property
Private Sub txtText_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtText.TextChanged
RaiseEvent NPCTextChanged(Me, TextItem, NPCText)
End Sub
End Class

View File

@@ -0,0 +1,99 @@
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Runtime.InteropServices
Namespace Support
Public Class Imaging
Public Shared Function RotateImage(ByVal img As Image, ByVal angle As Single) As Bitmap
Dim n9, n10, n11, n12 As Double
If img Is Nothing Then Return Nothing
Dim width As Double = img.Width
Dim height As Double = img.Height
Dim n3 As Double = (angle * Math.PI) / 180
Dim d As Double = n3
Do While (d < 0)
d += 2 * Math.PI
Loop
If (((d >= 0) AndAlso (d < Math.PI / 2)) OrElse ((d >= Math.PI) AndAlso (d < Math.PI * 1.5))) Then
n9 = Math.Abs(Math.Cos(d)) * width
n10 = Math.Abs(Math.Sin(d)) * width
n11 = Math.Abs(Math.Cos(d)) * height
n12 = Math.Abs(Math.Sin(d)) * height
Else
n9 = Math.Abs(Math.Sin(d)) * height
n10 = Math.Abs(Math.Cos(d)) * height
n11 = Math.Abs(Math.Sin(d)) * width
n12 = Math.Abs(Math.Cos(d)) * width
End If
Dim a As Double = n9 + n12
Dim n6 As Double = n11 + n10
Dim n7 As Integer = Math.Ceiling(a)
Dim n8 As Integer = Math.Ceiling(n6)
Dim bmp As Bitmap = New Bitmap(n7, n8)
Using gr As Graphics = Graphics.FromImage(bmp)
Dim pointArray() As Point
If ((d >= 0) AndAlso (d < Math.PI / 2)) Then
pointArray = New Point() {New Point(n12, 0), New Point(n7, n10), New Point(0, n11)}
ElseIf ((d >= Math.PI / 2) AndAlso (d < Math.PI)) Then
pointArray = New Point() {New Point(n7, n10), New Point(n9, n8), New Point(n12, 0)}
ElseIf ((d >= Math.PI) AndAlso (d < Math.PI * 1.5)) Then
pointArray = New Point() {New Point(n9, n8), New Point(0, n11), New Point(n7, n10)}
Else
pointArray = New Point() {New Point(0, n11), New Point(n12, 0), New Point(n9, n8)}
End If
gr.DrawImage(img, pointArray)
End Using
Return bmp
End Function
Public Shared Sub BmpAddFast(ByVal from As Bitmap, ByVal addTo As Bitmap, ByVal area As Rectangle)
Dim bmpData As BitmapData = addTo.LockBits(area, ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb)
Dim destination(bmpData.Stride * bmpData.Height) As Byte
Marshal.Copy(bmpData.Scan0, destination, 0, destination.Length)
Dim bmpData2 As BitmapData = from.LockBits(New Rectangle(0, 0, from.Width, from.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb)
Dim source(bmpData2.Stride * bmpData2.Height) As Byte
Marshal.Copy(bmpData2.Scan0, source, 0, source.Length)
from.UnlockBits(bmpData2)
Dim cnt As Integer = 0
For i As Integer = from.Height - 1 To 0 Step -1
For j As Integer = 0 To from.Width - 1 Step 1
destination(cnt) = source(cnt)
cnt += 1
destination(cnt) = source(cnt)
cnt += 1
destination(cnt) = source(cnt)
cnt += 1
Next
Next
Marshal.Copy(destination, 0, bmpData.Scan0, destination.Length)
addTo.UnlockBits(bmpData)
End Sub
Public Shared Function BmpGetRegion(ByVal from As Bitmap, ByVal area As Rectangle) As Bitmap
Dim bgra As New Color()
Dim addTo As New Bitmap(area.Width, area.Height, PixelFormat.Format24bppRgb)
Dim bmpData As BitmapData = addTo.LockBits(New Rectangle(0, 0, area.Width, area.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb)
Dim destination(bmpData.Stride * bmpData.Height) As Byte
Marshal.Copy(bmpData.Scan0, destination, 0, destination.Length)
Dim cnt As Integer = 0
For i As Integer = area.Y To from.Height - 1 OrElse area.Bottom - 1 Step -1
For j As Integer = area.X To from.Width - 1 OrElse area.Right - 1 Step 1
bgra = from.GetPixel(j, i)
destination(cnt) = bgra.B
cnt += 1
destination(cnt) = bgra.G
cnt += 1
destination(cnt) = bgra.R
cnt += 1
Next
Next
Marshal.Copy(destination, 0, bmpData.Scan0, destination.Length)
addTo.UnlockBits(bmpData)
Return addTo
End Function
End Class
End Namespace

View File

@@ -0,0 +1,38 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.225
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = false
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.rylCoder.frmNpcEdit
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>frmNpcEdit</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<SaveMySettingsOnExit>false</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("RYL data file editor")>
<Assembly: AssemblyDescription("R.Y.L mcf & gsf file decrypter, decompiler, crypter and compiler. Lets you directly edit the content of ryl data files" & vbnewline & vbnewline & "Official tester: MorbidA" & vbnewline & "Wrapper library by FischR")>
<Assembly: AssemblyCompany("Home ^_^")>
<Assembly: AssemblyProduct("rylCoder")>
<Assembly: AssemblyCopyright("Copyright © 2006 - 2007 AlphA")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("264991da-35ed-46be-b4cd-4fb3ca56b0ee")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.0.0")>
<Assembly: AssemblyFileVersion("2.7.0.0")>

View File

@@ -0,0 +1,205 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.225
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("rylCoder.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
Friend ReadOnly Property about() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("about", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
'''&lt;!--
'''################################################
'''## ##
'''## RYL mcf &amp; gsf file editor ##
'''## ##
'''## (C) 2006 &amp; 2007 AlphA ##
'''## ##
'''## This source is for private development. ##
'''## You can have this source only with the ##
'''## owners permission. ##
'''## [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property gsfStruct() As String
Get
Return ResourceManager.GetString("gsfStruct", resourceCulture)
End Get
End Property
Friend ReadOnly Property npcShopBg() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("npcShopBg", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property npcShopNotFound() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("npcShopNotFound", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property showOnMapSmall() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("showOnMapSmall", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property splash() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("splash", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property X_mark() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("X_mark", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property Xa_mark() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Xa_mark", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
'''&lt;syntax&gt;
''' &lt;ryl version=&quot;2&quot;&gt;
''' &lt;mcf type=&quot;1&quot;&gt;
''' &lt;!-- NPCscript.mcf --&gt;
''' &lt;func name=&quot;AddItem&quot; parcount=&quot;5&quot; desc=&quot;Add a new item to NPC shop&quot;&gt;
''' &lt;param type=&quot;int&quot; name=&quot;NPC id&quot; desc=&quot;The NPC ID to who&apos;s shop to add current item&quot; /&gt;
''' &lt;param type=&quot;int&quot; name=&quot;Shop&quot; desc=&quot;If the NPC has multiple shops then each shop has its id starting from 0. Default is 0. Reference to AddPopup();&quot; /&gt;
''' &lt;param type=&quot;int&quot; name=&quot;Tab&quot; desc=&quot;Tab ID. From 0 [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property xmlFunctionSyntax() As String
Get
Return ResourceManager.GetString("xmlFunctionSyntax", resourceCulture)
End Get
End Property
Friend ReadOnly Property zone_1() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_1", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_12() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_12", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_16() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_16", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_2() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_2", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_3() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_3", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_4() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_4", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_5() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_5", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property zone_8() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("zone_8", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\about.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gsfStruct" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gsfStruct.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="npcShopBg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\npcShopBg.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="npcShopNotFound" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\npcShopNotFound.PNG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="showOnMapSmall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\showOnMapSmall.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="splash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\splash.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="X_mark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\showOnMap.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Xa_mark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\showOnMapActive.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xmlFunctionSyntax" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\xmlFunctionSyntax.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="zone_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_1.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_12" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_12.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_16.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_2.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_3.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_4.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_5.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="zone_8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zone_8.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.225
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.rylCoder.My.MySettings
Get
Return Global.rylCoder.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -0,0 +1,394 @@
<?xml version="1.0" encoding="utf-8" ?>
<syntax>
<ryl version="2">
<mcf type="1">
<!-- NPCscript.mcf -->
<func name="AddItem" parcount="5" desc="Add a new item to NPC shop">
<param type="int" name="NPC id" desc="The NPC ID to who's shop to add current item" />
<param type="int" name="Shop" desc="If the NPC has multiple shops then each shop has its id starting from 0. Default is 0. Reference to AddPopup();" />
<param type="int" name="Tab" desc="Tab ID. From 0 to 3" />
<param type="int" name="Page" desc="Page ID. Starting from 0" />
<param type="int" name="Item" desc="Item ID. Reference to itemscript.gsf" />
</func>
<func name="AddDialog" parcount="4" desc="Add a new dialogue to the NPC (opens when clicked on 'Talk To')">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this dialogue" />
<param type="int" name="Page" desc="The page number of the current npc's dialogue. Default 1" />
<param type="int" name="Unknown" desc="Can be the size of the dialog. Or the template window to use." />
<param type="string" name="Text" desc="The message to add to this dialogue" />
</func>
<func name="AddPopup" parcount="7" desc="Add a new menu item to the NPC's menu when clicking on it in game">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this popup" />
<param type="int" name="Command" desc="The type of the popup. What happens if its clicked. 0x2710 means to open the dialogue, 0x191 means to open a shop." />
<param type="int" name="Params" desc="Subtype of the popup. If type is dialogue then this should be 0, if its a shop then the kind of the shop(0x3E akkan armor)" />
<param type="string" name="Text" desc="Text to show in the menu" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Class" desc="Class who can see this option. 1-fighter, 2-rogue, 4-mage, 8-acolyte, 0x10000-combatant, 0x20000-officiator, 0xFF0FFF-everyone" />
</func>
<func name="AddQuest" parcount="2" desc="Add a quest starting point to a NPC">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this quest" />
<param type="int" name="Quest" desc="The quest ID" />
</func>
<func name="AddQuestWords" parcount="3" desc="Add green message to NPC head if the quest is available">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this message" />
<param type="int" name="Quest" desc="The quest ID. If the quest comes avalable to the player the text is shown" />
<param type="string" name="Text" desc="The message to show" />
</func>
<func name="AddWords" parcount="2" desc="Add a message to NPC which is displayed in chat">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this message" />
<param type="string" name="Text" desc="The message to show" />
</func>
<func name="AddZoneMove" parcount="5" desc="Set the target position of a zone teleport to a NPC">
<param type="int" name="NPC id" desc="The NPC ID to set on this position" />
<param type="int" name="Zone" desc="Zone ID where the player is moved to" />
<param type="float" name="X" desc="X cordinate (e.g. from the left side of the map)" />
<param type="float" name="Y" desc="Y cordinate (e.g. the height)" />
<param type="float" name="Z" desc="Z cordinate (e.g. from the bottom of the map)" />
</func>
<func name="SetDropBase" parcount="7" desc="Set the drop base of random EQ shop">
<param type="int" name="NPC id" desc="The NPC ID to who's shop it apply's" />
<param type="int" name="Unknown" desc="Seems to be something's id (have seen 0 or 1)" />
<param type="int" name="A" desc="A grade" />
<param type="int" name="B" desc="B grade" />
<param type="int" name="C" desc="C grade" />
<param type="int" name="D" desc="D grade" />
<param type="int" name="F" desc="F grade" />
</func>
<func name="SetDropGrade" parcount="7" desc="Set the drop grade(chance) of random EQ shop">
<param type="int" name="NPC id" desc="The NPC ID to who's shop it apply's" />
<param type="int" name="Unknown" desc="Seems to be something's id (have seen 0 or 1)" />
<param type="int" name="A" desc="A grade" />
<param type="int" name="B" desc="B grade" />
<param type="int" name="C" desc="C grade" />
<param type="int" name="D" desc="D grade" />
<param type="int" name="F" desc="F grade" />
</func>
<func name="SetNPC" parcount="6" desc="Add a new NPC">
<param type="int" name="Zone" desc="Zone ID where to add it" />
<param type="int" name="NPC id" desc="The Unique NPC ID" />
<param type="int" name="Unknown" desc="Seems to be always the same 0x10000001" />
<param type="bool" name="Unknown" desc="Seems to be false always" />
<param type="string" name="Texture" desc="Texture/model of the NPC" />
<param type="string" name="Name" desc="Name\\Description of the NPC" />
</func>
<func name="SetPosition" parcount="5" desc="Set the position of a NPC">
<param type="int" name="NPC id" desc="The NPC ID to set on this position" />
<param type="float" name="Dir" desc="Direction of the NPC where he is facing" />
<param type="float" name="X" desc="X cordinate (e.g. from the left side of the map)" />
<param type="float" name="Y" desc="Y cordinate (e.g. the height)" />
<param type="float" name="Z" desc="Z cordinate (e.g. from the bottom of the map)" />
</func>
<func name="SetNPCAttribute" parcount="3" desc="Set attributes of the NPC">
<param type="int" name="NPC id" desc="The NPC ID to whom to apply these attributes" />
<param type="int" name="Type" desc="NPC type / How is it showed on the mini map (0xB-weapon, 0x13-vault, 0x10 Trainer)" />
<param type="int" name="Nation" desc="Nation of the NPC. 0-neutral, 1-human, 2-akkan, 3-pirate" />
</func>
</mcf>
<mcf type="2">
<!-- Quest.mcf -->
<func name="QuestStart" parcount="7" desc="Quest start tag" level="1" siblings="-1">
<param type="int" name="Quest ID" desc="Unique ID of the quest. Starting with a F means that this quest can't be deleted" />
<param type="int" name="Min lvl" desc="The minimum level the player has to be to do the quest" />
<param type="int" name="Max lvl" desc="The maximum level the player can be to do the quest" />
<param type="int" name="Class" desc="0x000FFF - Humans, 0xFF0000 - Akkans, 0xFF0FFF - all; 10 defender, 20 warrior, 40 sin, 80 arch, 100 sourc, 200 ench, 400 priest, 800 cleric. Akkans are 0x1..." />
<param type="int" name="Existsing quest" desc="The ID of the quest the player has to have to do the quest" />
<param type="int" name="Nation" desc="0-all, 1-humans, 2-akkans, 3-pirates" />
<param type="bool" name="Unknown" desc="" />
</func>
<func name="QuestEnd" parcount="0" desc="Quest End tag" level="1" siblings="0" />
<func name="QuestSkillPointBonus" parcount="1" desc="Gives the player Skillpoints">
<param type="int" name="amount" desc="Number of Skillpoints to add to the player" />
</func>
<func name="QuestType" parcount="2" desc="Specifies the quest type" level="2" siblings="0">
<param type="int" name="Quest Type" desc="Talk to npc=0, Use a item=1, Go to some area=2" />
<param type="int" name="Party Type" desc="Single=0, Party=1" />
</func>
<!--
<func name="QuestArea" parcount="2" desc="Type of Quest">
<param type="int" name="Quest Type" desc="Quest type NPC=0, ITEM=1, AREA=2" />
<param type="int" name="Party Type" desc="Quest type NORMAL=0, PARTY=1" />
</func>-->
<func name="QuestTitle" parcount="1" desc="Quest title, has to be within 11 chars" level="2" siblings="0">
<param type="string" name="Title" desc="Quest title (11 chars or less)" />
</func>
<func name="QuestDesc" parcount="1" desc="Conversation message when NPC asks for a quest" level="2" siblings="0">
<param type="string" name="Text" desc="Conversation message when NPC asks for a quest" />
</func>
<func name="QuestShortDesc" parcount="1" desc="Summary of Quest objectives" level="2" siblings="0">
<param type="string" name="Summary" desc="Summary of Quest objectives" />
</func>
<func name="QuestIcon" parcount="5" desc="Icon registered on quest window when a quest has been received" level="2" siblings="0">
<param type="string" name="sprite" desc="DDS file name" />
<param type="int" name="min X" desc="top/left edge X" />
<param type="int" name="min Y" desc="top/left edge Y" />
<param type="int" name="max X" desc="Bottom/right edge X" />
<param type="int" name="max Y" desc="Bottom/right edge Y" />
</func>
<func name="QuestCompleteSave" parcount="1" desc="Weather the quest should be saved or no (on completed quests list)" level="2" siblings="0">
<param type="Bool" name="Save True/False" desc="True/False" />
</func>
<func name="QuestLevel" parcount="1" desc="Degree of difficulty of quest" level="2" siblings="0">
<param type="string" name="Level" desc="Example: LV 10" />
</func>
<func name="QuestAward" parcount="1" desc="Quest reward description" level="2" siblings="0">
<param type="string" name="Reward text" desc="Example: - Experience 520\\- Gold 4,800\\- C Grade Item (Random)" />
</func>
<func name="AddPhase" parcount="3" desc="Addition of Phase(Zone Number, Page Number, Summary of Phase)" level="2" siblings="-1">
<param type="int" name="Zone" desc="Zone: Zone12=0xC, Zone16=0xC, Zone8=8" />
<param type="int" name="Phase #" desc="Phase number, every phase in the same quest has it's own." />
<param type="string" name="Text" desc="Phase text" />
</func>
<func name="Phase_Target" parcount="2" desc="Mark the location of hint for current phase on entire map (X coordinate, Y coordinate)" level="3" siblings="0">
<param type="int" name="X coordinate" desc="X coordinate" />
<param type="int" name="Y coordinate" desc="Y coordinate" />
</func>
<func name="Trigger_Start" parcount="0" desc="Trigger entered when begining a quest" level="3" siblings="-1" />
<func name="Trigger_Puton" parcount="6" desc="Trigger generating an event when an item is positioned at the relevent location (Item ID, Zone ID, x, y, z, Zone Size)" level="3" siblings="-1">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Zone ID" desc="Zone ID" />
<param type="float" name="X" desc="X coordinate" />
<param type="float" name="Y" desc="Y coordinate" />
<param type="float" name="Z" desc="Z coordinate" />
<param type="float" name="Zone Size" desc="Zone Size" />
</func>
<func name="Trigger_Geton" parcount="6" desc="Triggers when dashing into the relevent coordinate system (Item ID, Zone ID, x, y, z, Zone Size)" level="3" siblings="-1">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Zone ID" desc="Zone ID" />
<param type="float" name="X" desc="X coordinate" />
<param type="float" name="Y" desc="Y coordinate" />
<param type="float" name="Z" desc="Z coordinate" />
<param type="float" name="Zone Size" desc="Zone Size" />
</func>
<func name="Trigger_Talk" parcount="1" desc="Triggered when talking with the relevant NPC (NPC ID)" level="3" siblings="-1">
<param type="int" name="NPC ID" desc="NPC ID" />
</func>
<func name="Trigger_Kill" parcount="2" desc="Triggered when certain number of relevent monster has been killed (Number to be killed, Monster ID)" level="3" siblings="-1">
<param type="int" name="Amount" desc="Amount to be killed" />
<param type="int" name="Monster ID" desc="Monster ID" />
</func>
<func name="Trigger_Pick" parcount="2" desc="Triggers when specified number of items are placed into Inventory (Quantity, Item ID)" level="3" siblings="-1">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
</func>
<func name="Trigger_Fame" parcount="1" desc="Triggered when fame has been collected until sepcific fame amount (Fame)" level="3" siblings="-1">
<param type="int" name="Fame" desc="Amount of Fame" />
</func>
<func name="Trigger_LevelTalk" parcount="2" desc="Triggered when talking to the NPC at a relevent level (Level, NPC ID, ElseMsg)" level="3" siblings="-1">
<param type="int" name="Level" desc="Level" />
<param type="int" name="NPC ID" desc="NPC ID" />
<param type="string" name="Text" desc="Else Message" />
</func>
<func name="Else" parcount="0" desc="When the player hasn't meet all the requirements (event_disappear,trigger_talk,..)" level="3" siblings="-1"/>
<func name="Event_Disappear" parcount="3" desc="Hides the corresponding item (Quantity, Item ID, Gold)" level="4" siblings="0">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Gold" desc="Gold" />
</func>
<func name="Event_Get" parcount="2" desc="Give relevent Item to a player character(Quantity, Item ID)" level="4" siblings="0">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
</func>
<func name="Event_Spawn" parcount="4" desc="Spawn relevent Monster (Monster ID, x,y,z)" level="4" siblings="0">
<param type="int" name="Monster ID" desc="Monster ID" />
<param type="float" name="X" desc="X" />
<param type="float" name="Y" desc="Y" />
<param type="float" name="Z" desc="Z" />
</func>
<func name="Event_MonsterDrop" parcount="2" desc="Monster drops relevent Item and Quantity (Item ID, Quantity)" level="4" siblings="0">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Quantity" desc="Quantity" />
</func>
<func name="Event_Award" parcount="4" desc="quest reward (Experience, Gold, Fame, Medal)" level="4" siblings="0">
<param type="int" name="EXP" desc="Experience" />
<param type="int" name="Gold" desc="Gold" />
<param type="int" name="Fame" desc="Fame" />
<param type="int" name="Medals" desc="Medals" />
</func>
<func name="Event_MsgBox" parcount="1" desc="Call message box (Message content is forced to begin a new line by '\\')" level="4" siblings="0">
<param type="string" name="Text" desc="Message box text, begin with \\" />
</func>
<func name="Event_Phase" parcount="1" desc="Skip to relevent phase number(Phase number)" level="4" siblings="0">
<param type="int" name="Phase #" desc="Phase Number" />
</func>
<func name="Event_End" parcount="0" desc="End of event, Completed without moving to a phase. Removes from active quest window." level="4" siblings="0"/>
<func name="Event_AwardItem" parcount="4" desc="Reward Graded Item(Item type, LV of PC, Item Grade) ??Item type to suit class of 0 = PC ??Level to suit level of 0=PC" level="4" siblings="0">
<param type="int" name="Type" desc="Item Type to suit NPC" />
<param type="int" name="Level" desc="Level of NPC" />
<param type="int" name="Grade" desc="Item Grade" />
<param type="int" name="Type" desc="Item Type to suit class" />
</func>
<func name="Event_AddQuest" parcount="2" desc="Force relevent quest to be registered (NPC ID giving quest, Quest ID forced to be registsred) ??0xFxxx is a quest that can not be cancelled" level="4" siblings="0">
<param type="int" name="NPC ID" desc="NPC ID" />
<param type="int" name="Quest ID" desc="Quest ID" />
</func>
<func name="Event_Move" parcount="3" desc="Move to X,Y coordinate of concerened zone (Zone, X, Y)" level="4" siblings="0">
<param type="int" name="Zone" desc="Zone ID" />
<param type="float" name="X" desc="X coordinate" />
<param type="float" name="Y" desc="Y coordinate" />
</func>
<func name="Event_TheaterMode" parcount="0" desc="Turn on Theater Mode" level="4" siblings="0"/>
</mcf>
<mcf type="3">
<func name="AddString" parcount="2" desc="Adds a string to the game with the specific ID">
<param type="int" name="ID" desc="Specifies the id of the text" />
<param type="string" name="Text" desc="Text to add" />
</func>
<func name="AddString" parcount="1" desc="Adds a string to the game">
<param type="string" name="Text" desc="Text to add" />
</func>
<func name="RylNation" parcount="3" desc="Specifies the game nation">
<param type="int" name="Nation" desc="0=default, 1=Taiwan, 2=Japan, 3=China, 4=Thai, 5=Malaysia, 6=USA, 7=Indonesia, 8=Vietnam" />
<param type="int" name="Unknown" desc="" />
<param type="string" name="Name" desc="e.g. RYLCib, RYLPotE" />
</func>
</mcf>
</ryl>
<ryl version="1">
<mcf type="1">
<!-- NPCscript.mcf -->
<func name="AddItem" parcount="4" desc="Add a new item to NPC shop">
<param type="int" name="NPC id" desc="The NPC ID to who's shop to add current item" />
<param type="int" name="Item" desc="Item ID. Reference to itemscript.gsf" />
<param type="int" name="Tab" desc="Tab ID. From 0 to 3" />
<param type="int" name="Page?" desc="Page ID. Starting from 0" />
</func>
<func name="AddDialog" parcount="4" desc="Add a new dialogue to the NPC (opens when clicked on 'Talk To')">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this dialogue" />
<param type="int" name="Page" desc="The page number of the current npc's dialogue. Default 1" />
<param type="int" name="Unknown" desc="" />
<param type="string" name="Text" desc="The message to add to this dialogue" />
</func>
<func name="AddQuest" parcount="7" desc="Add a quest starting point to a NPC">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this quest" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Unknown" desc="" />
<param type="int" name="Unknown" desc="" />
<param type="string" name="Quest" desc="The quest ID name" />
</func>
<func name="AddWords" parcount="2" desc="Add a message to NPC's head">
<param type="int" name="NPC id" desc="The NPC ID to whom to add this message" />
<param type="string" name="Text" desc="The message to show" />
</func>
<func name="AddZoneMove" parcount="5" desc="Set the target position of a zone teleport to a NPC">
<param type="int" name="NPC id" desc="The NPC ID to set on this position" />
<param type="int" name="Zone" desc="Zone ID where the player is moved to" />
<param type="float" name="X" desc="X cordinate (e.g. from the left side of the map)" />
<param type="float" name="Y" desc="Y cordinate (e.g. the height)" />
<param type="float" name="Z" desc="Z cordinate (e.g. from the bottom of the map)" />
</func>
<func name="SetNPC" parcount="5" desc="Add a new NPC">
<param type="int" name="Zone" desc="Zone ID where to add it" />
<param type="int" name="NPC id" desc="The Unique NPC ID" />
<param type="int" name="Type" desc="NPC type / How is it showed on the mini map (0xB-weapon, 0x13-vault, 0x10 Trainer)" />
<param type="string" name="Texture" desc="Texture/model of the NPC" />
<param type="string" name="Name" desc="Name of the NPC" />
</func>
<func name="SetPosition" parcount="5" desc="Set the position of a NPC">
<param type="int" name="NPC id" desc="The NPC ID to set on this position" />
<param type="float" name="Dir" desc="Direction of the NPC where he is facing" />
<param type="float" name="X" desc="X cordinate (e.g. from the left side of the map)" />
<param type="float" name="Y" desc="Y cordinate (e.g. the height)" />
<param type="float" name="Z" desc="Z cordinate (e.g. from the bottom of the map)" />
</func>
</mcf>
<mcf type="2">
<!-- Quest.mcf -->
<func name="QuestTitle" parcount="1" desc="Quest title, has to be within 11 chars" level="2" siblings="0">
<param type="string" name="Title" desc="Quest title (11 chars or less)" />
</func>
<func name="QuestDesc" parcount="1" desc="Conversation message when NPC asks for a quest" level="2" siblings="0">
<param type="string" name="Text" desc="Conversation message when NPC asks for a quest" />
</func>
<func name="QuestShortDesc" parcount="1" desc="Summary of Quest objectives" level="2" siblings="0">
<param type="string" name="Summary" desc="Summary of Quest objectives" />
</func>
<func name="QuestIcon" parcount="5" desc="Icon registered on quest window when a quest has been received" level="2" siblings="0">
<param type="string" name="sprite" desc="DDS file name" />
<param type="int" name="min X" desc="top/left edge X" />
<param type="int" name="min Y" desc="top/left edge Y" />
<param type="int" name="max X" desc="Bottom/right edge X" />
<param type="int" name="max Y" desc="Bottom/right edge Y" />
</func>
<func name="QuestCompleteSave" parcount="1" desc="Weather the quest should be saved or no (on completed quests list)" level="2" siblings="0">
<param type="Bool" name="Save True/False" desc="True/False" />
</func>
<func name="QuestLevel" parcount="1" desc="Degree of difficulty of quest" level="2" siblings="0">
<param type="string" name="Level" desc="Example: LV 10" />
</func>
<func name="QuestAward" parcount="1" desc="Quest reward description" level="2" siblings="0">
<param type="string" name="Reward text" desc="Example: - Experience 520\\- Gold 4,800\\- C Grade Item (Random)" />
</func>
<func name="AddPhase" parcount="3" desc="Addition of Phase(Zone Number, Page Number, Summary of Phase)" level="2" siblings="-1">
<param type="int" name="Zone" desc="Zone: Zone12=0xC, Zone16=0xC, Zone8=8" />
<param type="int" name="Phase #" desc="Phase number, every phase in the same quest has it's own." />
<param type="string" name="Text" desc="Phase text" />
</func>
<func name="Phase_Target" parcount="2" desc="Mark the location of hint for current phase on entire map (X coordinate, Y coordinate)" level="3" siblings="0">
<param type="int" name="X coordinate" desc="X coordinate" />
<param type="int" name="Y coordinate" desc="Y coordinate" />
</func>
<func name="Trigger_Start" parcount="0" desc="Trigger entered when begining a quest" level="3" siblings="-1" />
<func name="Trigger_Puton" parcount="6" desc="Trigger generating an event when an item is positioned at the relevent location (Item ID, Zone ID, x, y, z, Zone Size)" level="3" siblings="-1">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Zone ID" desc="Zone ID" />
<param type="float" name="X" desc="X coordinate" />
<param type="float" name="Y" desc="Y coordinate" />
<param type="float" name="Z" desc="Z coordinate" />
<param type="float" name="Zone Size" desc="Zone Size" />
</func>
<func name="Trigger_Geton" parcount="6" desc="Triggers when dashing into the relevent coordinate system (Item ID, Zone ID, x, y, z, Zone Size)" level="3" siblings="-1">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Zone ID" desc="Zone ID" />
<param type="float" name="X" desc="X coordinate" />
<param type="float" name="Y" desc="Y coordinate" />
<param type="float" name="Z" desc="Z coordinate" />
<param type="float" name="Zone Size" desc="Zone Size" />
</func>
<func name="Trigger_Talk" parcount="1" desc="Triggered when talking with the relevant NPC (NPC ID)" level="3" siblings="-1">
<param type="int" name="NPC ID" desc="NPC ID" />
</func>
<func name="Trigger_Kill" parcount="2" desc="Triggered when certain number of relevent monster has been killed (Number to be killed, Monster ID)" level="3" siblings="-1">
<param type="int" name="Amount" desc="Amount to be killed" />
<param type="int" name="Monster ID" desc="Monster ID" />
</func>
<func name="Trigger_Pick" parcount="2" desc="Triggers when specified number of items are placed into Inventory (Quantity, Item ID)" level="3" siblings="-1">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
</func>
<func name="Else" parcount="0" desc="When the player hasn't meet all the requirements (event_disappear,trigger_talk,..)" level="3" siblings="-1"/>
<func name="Event_Disappear" parcount="3" desc="Hides the corresponding item (Quantity, Item ID, Gold)" level="4" siblings="0">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Gold" desc="Gold" />
</func>
<func name="Event_Get" parcount="2" desc="Give relevent Item to a player character(Quantity, Item ID)" level="4" siblings="0">
<param type="int" name="Quantity" desc="Quantity" />
<param type="int" name="Item ID" desc="Item ID" />
</func>
<func name="Event_Spawn" parcount="4" desc="Spawn relevent Monster (Monster ID, x,y,z)" level="4" siblings="0">
<param type="int" name="Monster ID" desc="Monster ID" />
<param type="float" name="X" desc="X" />
<param type="float" name="Y" desc="Y" />
<param type="float" name="Z" desc="Z" />
</func>
<func name="Event_MonsterDrop" parcount="2" desc="Monster drops relevent Item and Quantity (Item ID, Quantity)" level="4" siblings="0">
<param type="int" name="Item ID" desc="Item ID" />
<param type="int" name="Quantity" desc="Quantity" />
</func>
<func name="Event_Award" parcount="2" desc="quest reward (Experience, Gold, Fame, Medal)" level="4" siblings="0">
<param type="int" name="EXP" desc="Experience" />
<param type="int" name="Gold" desc="Gold" />
</func>
<func name="Event_MsgBox" parcount="1" desc="Call message box (Message content is forced to begin a new line by '\\')" level="4" siblings="0">
<param type="string" name="Text" desc="Message box text, begin with \\" />
</func>
<func name="Event_Phase" parcount="1" desc="Skip to relevent phase number(Phase number)" level="4" siblings="0">
<param type="int" name="Phase #" desc="Phase Number" />
</func>
<func name="Event_End" parcount="0" desc="End of event, Completed without moving to a phase. Removes from active quest window." level="4" siblings="0"/>
</mcf>
</ryl>
</syntax>

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="mcfCoder">
</Property><Property Name="Solution File" Value="C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\mcfCoder.sln">
</Property><Property Name="User Options File" Value="C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\mcfCoder.suo">
</Property><Property Name="Date" Value="14. oktoober 2011. a.">
</Property><Property Name="Time" Value="13:17">
</Property></Properties><Event ErrorLevel="0" Project="" Source="mcfCoder.sln" Description="File successfully backed up as C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\mcfCoder.sln.old">
</Event><Event ErrorLevel="2" Project="" Source="mcfCoder.suo" Description="Error creating backup file: C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\mcfCoder.suo.old">
</Event><Event ErrorLevel="0" Project="rylCoder" Source="rylCoder.vbproj" Description="Project file successfully backed up as C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\rylCoder.vbproj.old">
</Event><Event ErrorLevel="0" Project="rylCoder" Source="rylCoder.vbproj.user" Description="Project user file successfully backed up as C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\rylCoder.vbproj.user.old">
</Event><Event ErrorLevel="1" Project="rylCoder" Source="rylCoder.vbproj" Description="Your project is targeting .NET Framework 2.0 or 3.0. If your project uses assemblies requiring a newer .NET Framework, your project will fail to build. You can change the .NET Framework version by clicking Properties on the project menu and then selecting a new version in the '.NET Framework' dropdown box. (In Visual Basic, this is located on the Compile tab by clicking the 'Advanced Compiler Options...' button.)">
</Event><Event ErrorLevel="0" Project="rylCoder" Source="rylCoder.vbproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="rylCoder" Source="rylCoder.vbproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Converting project file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\Wrapper\Wrapper.vcproj'.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'AssemblyReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'ProjectReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'ProjectReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'CopyLocalDependencies' of 'ProjectReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Attribute 'UseDependenciesInBuild' of 'ProjectReference' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="MSB8012: $(TargetPath) ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\Wrapper\Debug\Wrapper.dll') does not match the Linker's OutputFile property value 'Debug\Wrapper.dll' ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\Debug\Wrapper.dll') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).">
</Event><Event ErrorLevel="1" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="MSB8012: $(TargetPath) ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\Wrapper\Release\Wrapper.dll') does not match the Linker's OutputFile property value 'Release\Wrapper.dll' ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\Release\Wrapper.dll') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).">
</Event><Event ErrorLevel="0" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Done converting to new project file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\Wrapper\Wrapper.vcxproj'.">
</Event><Event ErrorLevel="3" Project="Wrapper" Source="addons\Wrapper\Wrapper.vcproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="Converting project file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\DevIL\src-IL\msvc8\IL.vcproj'.">
</Event><Event ErrorLevel="1" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="Failed to upgrade platform 'Pocket PC 2003 (ARMV4)'. Please make sure you have it installed under '%vctargetspath%\platforms\Pocket PC 2003 (ARMV4)'">
</Event><Event ErrorLevel="1" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="Failed to upgrade 'Debug|Pocket PC 2003 (ARMV4)'. Please make sure you have the corresponding platform installed under '%vctargetspath%\platforms\Pocket PC 2003 (ARMV4)'">
</Event><Event ErrorLevel="1" Project="C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\DevIL\src-IL\msvc8\IL.vcproj" Source="" Description="Cannot load the project due to a corrupt project file.">
</Event><Event ErrorLevel="2" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="The project configuration dimension name/value &quot;(Platform, Win32)&quot; was not found in the project manifest.">
</Event><Event ErrorLevel="2" Project="C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\DevIL\src-IL\msvc8\IL.vcproj" Source="" Description="The following error has occurred during XML parsing:&#xA;&#xA;File: C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\DevIL\src-IL\msvc8\IL.vcproj&#xA;Line: 190&#xA;Column: 5&#xA;Error Message:&#xA;System error: -2147154677.&#xA;&#xA;The file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\DevIL\src-IL\msvc8\IL.vcproj' has failed to load.">
</Event><Event ErrorLevel="2" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="Project upgrade failed.">
</Event><Event ErrorLevel="3" Project="IL" Source="addons\DevIL\src-IL\msvc8\IL.vcproj" Description="Not Converted">
</Event><Event ErrorLevel="0" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="Converting project file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\MiniLZO\MiniLZO.vcproj'.">
</Event><Event ErrorLevel="1" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="1" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="MSB8012: $(TargetPath) ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\MiniLZO\Debug\MiniLZO.lib') does not match the Librarian's OutputFile property value 'Debug\MiniLZO.lib' ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\Debug\MiniLZO.lib') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).">
</Event><Event ErrorLevel="1" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="MSB8012: $(TargetPath) ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\MiniLZO\Release\MiniLZO.lib') does not match the Librarian's OutputFile property value 'Release\MiniLZO.lib' ('C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\Release\MiniLZO.lib') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).">
</Event><Event ErrorLevel="0" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="Done converting to new project file 'C:\Users\Peter\Desktop\rylCoder_16.02.2008_src\addons\MiniLZO\MiniLZO.vcxproj'.">
</Event><Event ErrorLevel="3" Project="MiniLZO" Source="addons\MiniLZO\MiniLZO.vcproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="mcfCoder.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="mcfCoder.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="rylCoder" Source="rylCoder.vbproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>

View File

@@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">Solution</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">Project</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">Converted</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Converted</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Report - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> files</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 file</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">Converted</a>:&#32;<xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
<a _locID="NotConverted">Not converted</a>:&#32;<xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title _locID="ConversionReport0">Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

View File

@@ -0,0 +1,13 @@
%module DevIL
%{
#include "IL/il.h"
#include "IL/ilu.h"
#include "IL/ilut.h"
//#include "IL/ilu_region.h"
%}
%include "IL/il.h"
%include "IL/ilu.h"
%include "IL/ilut.h"
//%include "IL/ilu_region.h"

View File

@@ -0,0 +1,147 @@
/* include/IL/config.h. Generated by configure. */
/* include/IL/config.h.in. Generated from configure.in by autoheader. */
#ifndef __CONFIG_H__
#define __CONFIG_H__
/* Supported images formats (il) */
/* #undef IL_NO_BMP */
/* #undef IL_NO_CUT */
/* #undef IL_NO_CHEAD */
/* #undef IL_NO_DCX */
#define IL_NO_CUT
#define IL_NO_CHEAD
#define IL_NO_DCX
/* #undef IL_NO_DDS */
/* #undef IL_NO_DOOM */
/* #undef IL_NO_GIF */
/* #undef IL_NO_HDR */
/* #undef IL_NO_ICO */
/* #undef IL_NO_JPG */
#define IL_NO_DOOM
#define IL_NO_GIF
#define IL_NO_HDR
#define IL_NO_ICO
#define IL_NO_JPG
/* #undef IL_NO_LIF */
/* #undef IL_NO_MDL */
#define IL_NO_LIF
#define IL_NO_MDL
#define IL_NO_MNG
/* #undef IL_NO_PCD */
/* #undef IL_NO_PCX */
/* #undef IL_NO_PIC */
/* #undef IL_NO_PIX */
/* #undef IL_NO_PNG */
/* #undef IL_NO_PNM */
/* #undef IL_NO_PSD */
/* #undef IL_NO_PSP */
/* #undef IL_NO_PXR */
/* #undef IL_NO_RAW */
/* #undef IL_NO_SGI */
/* #undef IL_NO_TGA */
/* #undef IL_NO_TIF */
/* #undef IL_NO_WAL */
/* #undef IL_NO_XPM */
#define IL_NO_PCD
#define IL_NO_PCX
#define IL_NO_PIC
#define IL_NO_PIX
#define IL_NO_PNG
#define IL_NO_PNM
#define IL_NO_PSD
#define IL_NO_PSP
#define IL_NO_PXR
#define IL_NO_RAW
#define IL_NO_SGI
#define IL_NO_TGA
#define IL_NO_TIF
#define IL_NO_WAL
#define IL_NO_XPM
#define IL_USE_JPEGLIB_UNMODIFIED 1
/* Supported api (ilut) */
//
// sorry just
// cant get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#define ILUT_USE_DIRECTX8 1
#define ILUT_USE_DIRECTX9 1
#define ILUT_USE_OPENGL 1
#define ILUT_USE_SDL 1
#define ILUT_USE_WIN32 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
//#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
//#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
//#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "DevIL"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.6.7"
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* If using Mac OS X uncomment this line */
/* #include "macconfig.h" */
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
#endif /* __CONFIG_H__ */

View File

@@ -0,0 +1,123 @@
/* include/IL/config.h. Generated by configure. */
/* include/IL/config.h.in. Generated from configure.in by autoheader. */
#ifndef __CONFIG_H__
#define __CONFIG_H__
/* Supported images formats (il) */
/* #undef IL_NO_BMP */
/* #undef IL_NO_CUT */
/* #undef IL_NO_CHEAD */
/* #undef IL_NO_DCX */
/* #undef IL_NO_DDS */
/* #undef IL_NO_DOOM */
/* #undef IL_NO_GIF */
/* #undef IL_NO_HDR */
/* #undef IL_NO_ICO */
/* #undef IL_NO_JPG */
#define IL_NO_LCMS
/* #undef IL_NO_LIF */
/* #undef IL_NO_MDL */
#define IL_NO_MNG
/* #undef IL_NO_PCD */
/* #undef IL_NO_PCX */
/* #undef IL_NO_PIC */
/* #undef IL_NO_PIX */
/* #undef IL_NO_PNG */
/* #undef IL_NO_PNM */
/* #undef IL_NO_PSD */
/* #undef IL_NO_PSP */
/* #undef IL_NO_PXR */
/* #undef IL_NO_RAW */
/* #undef IL_NO_SGI */
/* #undef IL_NO_TGA */
/* #undef IL_NO_TIF */
/* #undef IL_NO_WAL */
/* #undef IL_NO_XPM */
#define IL_USE_JPEGLIB_UNMODIFIED 1
/* Supported api (ilut) */
//
// sorry just
// cant get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#define ILUT_USE_DIRECTX8 1
#define ILUT_USE_DIRECTX9 1
#define ILUT_USE_OPENGL 1
#define ILUT_USE_SDL 1
#define ILUT_USE_WIN32 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
//#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
//#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
//#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "DevIL"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.6.7"
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* If using Mac OS X uncomment this line */
/* #include "macconfig.h" */
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
#endif /* __CONFIG_H__ */

View File

@@ -0,0 +1,150 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 02/19/2002 <--Y2K Compliant! =]
//
// Filename: IL/devil_internal_exports.h
//
// Description: Internal stuff for DevIL (IL, ILU and ILUT)
//
//-----------------------------------------------------------------------------
#ifndef IL_EXPORTS_H
#define IL_EXPORTS_H
#include "IL/il.h"
#ifndef NOINLINE
#ifndef INLINE
#if defined(__GNUC__)
#define INLINE extern inline
#elif defined(_MSC_VER)
#define NOINLINE
#define INLINE
//#define INLINE __inline
#else
#define INLINE inline
#endif
#endif
#else
#define INLINE
#endif //NOINLINE
#ifdef __cplusplus
extern "C" {
#endif
#define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
// Basic Palette struct
typedef struct ILpal
{
ILubyte* Palette; // the image palette (if any)
ILuint PalSize; // size of the palette (in bytes)
ILenum PalType; // the palette types below (0x0500 range)
} ILpal;
// The Fundamental Image struct
typedef struct ILimage {
ILuint Width; // the image's width
ILuint Height; // the image's height
ILuint Depth; // the image's depth
ILubyte Bpp; // bytes per pixel (now number of channels)
ILubyte Bpc; // bytes per channel
ILuint Bps; // bytes per scanline (components for IL)
ILubyte* Data; // the image data
ILuint SizeOfData; // the total size of the data (in bytes)
ILuint SizeOfPlane; // SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
ILenum Format; // image format (in IL enum style)
ILenum Type; // image type (in IL enum style)
ILenum Origin; // origin of the image
ILpal Pal; // palette details
ILuint Duration; // length of the time to display this "frame"
ILenum CubeFlags; // cube map flags for sides present in chain
struct ILimage* Mipmaps; // mipmapped versions of this image terminated by a NULL - usu. NULL
struct ILimage* Next; // next image in the chain - usu. NULL
struct ILimage* Layers; // subsequent layers in the chain - usu. NULL
// ILuint NumNext; // number of images following this one (0 when not parent). These are calculated on request
// ILuint NumMips; // number of mipmaps (0 when not parent)
// ILuint NumLayers; // number of layers (0 when not parent)
ILuint* AnimList; // animation list
ILuint AnimSize; // animation list size
ILvoid* Profile; // colour profile
ILuint ProfileSize; // colour profile size
ILuint OffX, OffY; // offset of the image
ILubyte* DxtcData; // compressed data
ILenum DxtcFormat; // compressed data format
ILuint DxtcSize; // compressed data size
} ILimage;
// Memory functions
ILAPI ILvoid* ILAPIENTRY ialloc(const ILuint Size);
ILAPI ILvoid ILAPIENTRY ifree(const ILvoid *Ptr);
ILAPI ILvoid* ILAPIENTRY icalloc(const ILuint Size, const ILuint Num);
#ifdef ALTIVEC_GCC
ILAPI ILvoid* ILAPIENTRY ivec_align_buffer(ILvoid *buffer, const ILuint size);
#endif
// Internal library functions in IL
ILAPI ILimage* ILAPIENTRY ilGetCurImage(ILvoid);
ILAPI ILvoid ILAPIENTRY ilSetCurImage(ILimage *Image);
ILAPI ILvoid ILAPIENTRY ilSetError(ILenum Error);
ILAPI ILvoid ILAPIENTRY ilSetPal(ILpal *Pal);
//
// Utility functions
//
ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
ILAPI ILenum ILAPIENTRY ilGetFormatBpp(ILubyte Bpp);
ILAPI ILubyte ILAPIENTRY ilGetBpcType(ILenum Type);
ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI ILvoid ILAPIENTRY ilReplaceCurImage(ILimage *Image);
ILAPI ILvoid ILAPIENTRY iMemSwap( ILubyte *, ILubyte *, const ILuint );
//
// Image functions
//
ILAPI ILvoid ILAPIENTRY iBindImageTemp (ILvoid);
ILAPI ILboolean ILAPIENTRY ilClearImage_ (ILimage *Image);
ILAPI ILvoid ILAPIENTRY ilCloseImage (ILimage *Image);
ILAPI ILvoid ILAPIENTRY ilClosePal (ILpal *Palette);
ILAPI ILpal* ILAPIENTRY iCopyPal (ILvoid);
ILAPI ILboolean ILAPIENTRY ilCopyImageAttr (ILimage *Dest, ILimage *Src);
ILAPI ILimage* ILAPIENTRY ilCopyImage_ (ILimage *Src);
ILAPI ILvoid ILAPIENTRY ilGetClear (ILvoid *Colours, ILenum Format, ILenum Type);
ILAPI ILuint ILAPIENTRY ilGetCurName (ILvoid);
ILAPI ILboolean ILAPIENTRY ilIsValidPal (ILpal *Palette);
ILAPI ILimage* ILAPIENTRY ilNewImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILimage* ILAPIENTRY ilNewImageFull (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILboolean ILAPIENTRY ilInitImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILboolean ILAPIENTRY ilResizeImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILboolean ILAPIENTRY ilTexImage_ (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILboolean ILAPIENTRY ilTexSubImage_ (ILimage *Image, ILvoid *Data);
ILAPI ILvoid* ILAPIENTRY ilConvertBuffer (ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILvoid *Buffer);
ILAPI ILimage* ILAPIENTRY iConvertImage (ILimage *Image, ILenum DestFormat, ILenum DestType);
ILAPI ILpal* ILAPIENTRY iConvertPal (ILpal *Pal, ILenum DestFormat);
ILAPI ILubyte* ILAPIENTRY iGetFlipped (ILimage *Image);
ILAPI ILboolean ILAPIENTRY iMirror();
ILAPI ILvoid ILAPIENTRY iFlipBuffer( ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num );
ILubyte *iFlipNewBuffer( ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num );
ILAPI ILvoid ILAPIENTRY iGetIntegervImage(ILimage *Image, ILenum Mode, ILint *Param);
// Internal library functions in ILU
ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
#ifdef __cplusplus
}
#endif
#endif//IL_EXPORTS_H

View File

@@ -0,0 +1,590 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 06/23/2002 <--Y2K Compliant! =]
//
// Filename: IL/il.h
//
// Description: The main include file for DevIL
//
//-----------------------------------------------------------------------------
#ifndef __il_h_
#ifndef __IL_H__
#define __il_h_
#define __IL_H__
#ifdef __cplusplus
extern "C" {
#endif
// Compiling Optionsok
#define IL_INLINE_ASM
//this define controls if floats and doubles are clampled to [0..1]
//during conversion. It takes a little more time, but it is the correct
//way of doing this. If you are sure your floats are always valid,
//you can undefine this value...
#define CLAMP_HALF 1
#define CLAMP_FLOATS 1
#define CLAMP_DOUBLES 1
#define IL_NO_GIF
#define IL_NO_JPG
#define IL_NO_MNG
#define IL_NO_PNG
#define IL_NO_TIF
#define IL_NO_LCMS
#ifdef _WIN32_WCE
#define IL_NO_GIF
#define IL_NO_JPG
#define IL_NO_MNG
#define IL_NO_PNG
#define IL_NO_TIF
#define IL_NO_LCMS
#endif //_WIN32_WCE
#ifdef DJGPP
#define IL_NO_GIF
#define IL_NO_JPG
#define IL_NO_MNG
#define IL_NO_PNG
#define IL_NO_TIF
#define IL_NO_LCMS
#endif //DJGPP
#ifdef _WIN32
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "DevIL.lib")
#endif
#endif
#endif
#ifdef RESTRICT_KEYWORD
#define RESTRICT restrict
#define CONST_RESTRICT const restrict
#else
#define RESTRICT
#define CONST_RESTRICT const
#endif
#include <stdio.h>
typedef unsigned int ILenum;
typedef unsigned char ILboolean;
typedef unsigned int ILbitfield;
typedef signed char ILbyte;
typedef signed short ILshort;
typedef int ILint;
typedef int ILsizei;
typedef unsigned char ILubyte;
typedef unsigned short ILushort;
typedef unsigned int ILuint;
typedef float ILfloat;
typedef float ILclampf;
typedef double ILdouble;
typedef double ILclampd;
typedef void ILvoid;
#include <limits.h>
#ifdef _UNICODE
#ifndef _WIN32_WCE
#include <wchar.h>
#endif
//if we use a define instead of a typedef,
//ILconst_string works as intended
#define ILstring wchar_t*
#define ILconst_string wchar_t const *
#else
//if we use a define instead of a typedef,
//ILconst_string works as intended
#define ILstring char*
#define ILconst_string char const *
#endif //_UNICODE
#define IL_FALSE 0
#define IL_TRUE 1
// Matches OpenGL's right now.
#define IL_COLOUR_INDEX 0x1900
#define IL_COLOR_INDEX 0x1900
#define IL_RGB 0x1907
#define IL_RGBA 0x1908
#define IL_BGR 0x80E0
#define IL_BGRA 0x80E1
#define IL_LUMINANCE 0x1909
#define IL_LUMINANCE_ALPHA 0x190A
#define IL_BYTE 0x1400
#define IL_UNSIGNED_BYTE 0x1401
#define IL_SHORT 0x1402
#define IL_UNSIGNED_SHORT 0x1403
#define IL_INT 0x1404
#define IL_UNSIGNED_INT 0x1405
#define IL_FLOAT 0x1406
#define IL_DOUBLE 0x140A
#define IL_HALF 0x140B
#define IL_MAX_BYTE SCHAR_MAX
#define IL_MAX_UNSIGNED_BYTE UCHAR_MAX
#define IL_MAX_SHORT SHRT_MAX
#define IL_MAX_UNSIGNED_SHORT USHRT_MAX
#define IL_MAX_INT INT_MAX
#define IL_MAX_UNSIGNED_INT UINT_MAX
#define limit(x,m,M) (x<m?m:(x>M?M:x))
#define clamp(x) limit(x,0,1)
#define IL_VENDOR 0x1F00
#define IL_LOAD_EXT 0x1F01
#define IL_SAVE_EXT 0x1F02
//
// IL-specific #define's
//
#define IL_VERSION_1_6_8 1
#define IL_VERSION 168
// Attribute Bits
#define IL_ORIGIN_BIT 0x00000001
#define IL_FILE_BIT 0x00000002
#define IL_PAL_BIT 0x00000004
#define IL_FORMAT_BIT 0x00000008
#define IL_TYPE_BIT 0x00000010
#define IL_COMPRESS_BIT 0x00000020
#define IL_LOADFAIL_BIT 0x00000040
#define IL_FORMAT_SPECIFIC_BIT 0x00000080
#define IL_ALL_ATTRIB_BITS 0x000FFFFF
// Palette types
#define IL_PAL_NONE 0x0400
#define IL_PAL_RGB24 0x0401
#define IL_PAL_RGB32 0x0402
#define IL_PAL_RGBA32 0x0403
#define IL_PAL_BGR24 0x0404
#define IL_PAL_BGR32 0x0405
#define IL_PAL_BGRA32 0x0406
// Image types
#define IL_TYPE_UNKNOWN 0x0000
#define IL_BMP 0x0420
#define IL_CUT 0x0421
#define IL_DOOM 0x0422
#define IL_DOOM_FLAT 0x0423
#define IL_ICO 0x0424
#define IL_JPG 0x0425
#define IL_JFIF 0x0425
#define IL_LBM 0x0426
#define IL_PCD 0x0427
#define IL_PCX 0x0428
#define IL_PIC 0x0429
#define IL_PNG 0x042A
#define IL_PNM 0x042B
#define IL_SGI 0x042C
#define IL_TGA 0x042D
#define IL_TIF 0x042E
#define IL_CHEAD 0x042F
#define IL_RAW 0x0430
#define IL_MDL 0x0431
#define IL_WAL 0x0432
#define IL_LIF 0x0434
#define IL_MNG 0x0435
#define IL_JNG 0x0435
#define IL_GIF 0x0436
#define IL_DDS 0x0437
#define IL_DCX 0x0438
#define IL_PSD 0x0439
#define IL_EXIF 0x043A
#define IL_PSP 0x043B
#define IL_PIX 0x043C
#define IL_PXR 0x043D
#define IL_XPM 0x043E
#define IL_HDR 0x043F
#define IL_JASC_PAL 0x0475
// Error Types
#define IL_NO_ERROR 0x0000
#define IL_INVALID_ENUM 0x0501
#define IL_OUT_OF_MEMORY 0x0502
#define IL_FORMAT_NOT_SUPPORTED 0x0503
#define IL_INTERNAL_ERROR 0x0504
#define IL_INVALID_VALUE 0x0505
#define IL_ILLEGAL_OPERATION 0x0506
#define IL_ILLEGAL_FILE_VALUE 0x0507
#define IL_INVALID_FILE_HEADER 0x0508
#define IL_INVALID_PARAM 0x0509
#define IL_COULD_NOT_OPEN_FILE 0x050A
#define IL_INVALID_EXTENSION 0x050B
#define IL_FILE_ALREADY_EXISTS 0x050C
#define IL_OUT_FORMAT_SAME 0x050D
#define IL_STACK_OVERFLOW 0x050E
#define IL_STACK_UNDERFLOW 0x050F
#define IL_INVALID_CONVERSION 0x0510
#define IL_BAD_DIMENSIONS 0x0511
#define IL_FILE_READ_ERROR 0x0512 // 05/12/2002: Addition by Sam.
#define IL_FILE_WRITE_ERROR 0x0512
#define IL_LIB_GIF_ERROR 0x05E1
#define IL_LIB_JPEG_ERROR 0x05E2
#define IL_LIB_PNG_ERROR 0x05E3
#define IL_LIB_TIFF_ERROR 0x05E4
#define IL_LIB_MNG_ERROR 0x05E5
#define IL_UNKNOWN_ERROR 0x05FF
// Origin Definitions
#define IL_ORIGIN_SET 0x0600
#define IL_ORIGIN_LOWER_LEFT 0x0601
#define IL_ORIGIN_UPPER_LEFT 0x0602
#define IL_ORIGIN_MODE 0x0603
// Format and Type Mode Definitions
#define IL_FORMAT_SET 0x0610
#define IL_FORMAT_MODE 0x0611
#define IL_TYPE_SET 0x0612
#define IL_TYPE_MODE 0x0613
// File definitions
#define IL_FILE_OVERWRITE 0x0620
#define IL_FILE_MODE 0x0621
// Palette definitions
#define IL_CONV_PAL 0x0630
// Load fail definitions
#define IL_DEFAULT_ON_FAIL 0x0632
// Key colour definitions
#define IL_USE_KEY_COLOUR 0x0635
#define IL_USE_KEY_COLOR 0x0635
// Interlace definitions
#define IL_SAVE_INTERLACED 0x0639
#define IL_INTERLACE_MODE 0x063A
// Quantization definitions
#define IL_QUANTIZATION_MODE 0x0640
#define IL_WU_QUANT 0x0641
#define IL_NEU_QUANT 0x0642
#define IL_NEU_QUANT_SAMPLE 0x0643
#define IL_MAX_QUANT_INDEXS 0x0644 //XIX : ILint : Maximum number of colors to reduce to, default of 256. and has a range of 2-256
// Hints
#define IL_FASTEST 0x0660
#define IL_LESS_MEM 0x0661
#define IL_DONT_CARE 0x0662
#define IL_MEM_SPEED_HINT 0x0665
#define IL_USE_COMPRESSION 0x0666
#define IL_NO_COMPRESSION 0x0667
#define IL_COMPRESSION_HINT 0x0668
// Subimage types
#define IL_SUB_NEXT 0x0680
#define IL_SUB_MIPMAP 0x0681
#define IL_SUB_LAYER 0x0682
// Compression definitions
#define IL_COMPRESS_MODE 0x0700
#define IL_COMPRESS_NONE 0x0701
#define IL_COMPRESS_RLE 0x0702
#define IL_COMPRESS_LZO 0x0703
#define IL_COMPRESS_ZLIB 0x0704
// File format-specific values
#define IL_TGA_CREATE_STAMP 0x0710
#define IL_JPG_QUALITY 0x0711
#define IL_PNG_INTERLACE 0x0712
#define IL_TGA_RLE 0x0713
#define IL_BMP_RLE 0x0714
#define IL_SGI_RLE 0x0715
#define IL_TGA_ID_STRING 0x0717
#define IL_TGA_AUTHNAME_STRING 0x0718
#define IL_TGA_AUTHCOMMENT_STRING 0x0719
#define IL_PNG_AUTHNAME_STRING 0x071A
#define IL_PNG_TITLE_STRING 0x071B
#define IL_PNG_DESCRIPTION_STRING 0x071C
#define IL_TIF_DESCRIPTION_STRING 0x071D
#define IL_TIF_HOSTCOMPUTER_STRING 0x071E
#define IL_TIF_DOCUMENTNAME_STRING 0x071F
#define IL_TIF_AUTHNAME_STRING 0x0720
#define IL_JPG_SAVE_FORMAT 0x0721
#define IL_CHEAD_HEADER_STRING 0x0722
#define IL_PCD_PICNUM 0x0723
#define IL_PNG_ALPHA_INDEX 0x0724 //XIX : ILint : the color in the pallete at this index value (0-255) is considered transparent, -1 for no trasparent color
// DXTC definitions
#define IL_DXTC_FORMAT 0x0705
#define IL_DXT1 0x0706
#define IL_DXT2 0x0707
#define IL_DXT3 0x0708
#define IL_DXT4 0x0709
#define IL_DXT5 0x070A
#define IL_DXT_NO_COMP 0x070B
#define IL_KEEP_DXTC_DATA 0x070C
#define IL_DXTC_DATA_FORMAT 0x070D
#define IL_3DC 0x070E
#define IL_RXGB 0x070F
#define IL_ATI1N 0x0710
// Cube map definitions
#define IL_CUBEMAP_POSITIVEX 0x00000400
#define IL_CUBEMAP_NEGATIVEX 0x00000800
#define IL_CUBEMAP_POSITIVEY 0x00001000
#define IL_CUBEMAP_NEGATIVEY 0x00002000
#define IL_CUBEMAP_POSITIVEZ 0x00004000
#define IL_CUBEMAP_NEGATIVEZ 0x00008000
// Values
#define IL_VERSION_NUM 0x0DE2
#define IL_IMAGE_WIDTH 0x0DE4
#define IL_IMAGE_HEIGHT 0x0DE5
#define IL_IMAGE_DEPTH 0x0DE6
#define IL_IMAGE_SIZE_OF_DATA 0x0DE7
#define IL_IMAGE_BPP 0x0DE8
#define IL_IMAGE_BYTES_PER_PIXEL 0x0DE8
#define IL_IMAGE_BPP 0x0DE8
#define IL_IMAGE_BITS_PER_PIXEL 0x0DE9
#define IL_IMAGE_FORMAT 0x0DEA
#define IL_IMAGE_TYPE 0x0DEB
#define IL_PALETTE_TYPE 0x0DEC
#define IL_PALETTE_SIZE 0x0DED
#define IL_PALETTE_BPP 0x0DEE
#define IL_PALETTE_NUM_COLS 0x0DEF
#define IL_PALETTE_BASE_TYPE 0x0DF0
#define IL_NUM_IMAGES 0x0DF1
#define IL_NUM_MIPMAPS 0x0DF2
#define IL_NUM_LAYERS 0x0DF3
#define IL_ACTIVE_IMAGE 0x0DF4
#define IL_ACTIVE_MIPMAP 0x0DF5
#define IL_ACTIVE_LAYER 0x0DF6
#define IL_CUR_IMAGE 0x0DF7
#define IL_IMAGE_DURATION 0x0DF8
#define IL_IMAGE_PLANESIZE 0x0DF9
#define IL_IMAGE_BPC 0x0DFA
#define IL_IMAGE_OFFX 0x0DFB
#define IL_IMAGE_OFFY 0x0DFC
#define IL_IMAGE_CUBEFLAGS 0x0DFD
#define IL_IMAGE_ORIGIN 0x0DFE
#define IL_IMAGE_CHANNELS 0x0DFF
# if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0))
// __attribute__((deprecated)) is supported by GCC 3.1 and later.
# define DEPRECATED(D) D __attribute__((deprecated))
# elif defined _MSC_VER && _MSC_VER >= 1300
// __declspec(deprecated) is supported by MSVC 7.0 and later.
# define DEPRECATED(D) __declspec(deprecated) D
# else
# define DEPRECATED (D) D
# endif
//
// Section shamelessly modified from the glut header.
//
// This is from Win32's <windef.h>
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
#define ILAPIENTRY __stdcall
#define IL_PACKSTRUCT
//#elif defined(linux) || defined(MACOSX) || defined(__CYGWIN__) //fix bug 840364
#elif defined( __GNUC__ )
// this should work for any of the above commented platforms
// plus any platform using GCC
#ifdef __MINGW32__
#define ILAPIENTRY __stdcall
#else
#define ILAPIENTRY
#endif
#define IL_PACKSTRUCT __attribute__ ((packed))
#else
#define ILAPIENTRY
#define IL_PACKSTRUCT
#endif
// This is from Win32's <wingdi.h> and <winnt.h>
#if defined(__LCC__)
#define ILAPI __stdcall
#elif defined(_WIN32) //changed 20031221 to fix bug 840421
#ifdef IL_STATIC_LIB
#define ILAPI
#else
#ifdef _IL_BUILD_LIBRARY
#define ILAPI __declspec(dllexport)
#else
#define ILAPI __declspec(dllimport)
#endif
#endif
#elif __APPLE__
#define ILAPI extern
#else
#define ILAPI
#endif
#define IL_SEEK_SET 0
#define IL_SEEK_CUR 1
#define IL_SEEK_END 2
#define IL_EOF -1
// Callback functions for file reading
typedef void* ILHANDLE;
typedef ILvoid (ILAPIENTRY *fCloseRProc)(ILHANDLE);
typedef ILboolean (ILAPIENTRY *fEofProc) (ILHANDLE);
typedef ILint (ILAPIENTRY *fGetcProc) (ILHANDLE);
typedef ILHANDLE (ILAPIENTRY *fOpenRProc) (ILconst_string);
typedef ILint (ILAPIENTRY *fReadProc) (void*, ILuint, ILuint, ILHANDLE);
typedef ILint (ILAPIENTRY *fSeekRProc) (ILHANDLE, ILint, ILint);
typedef ILint (ILAPIENTRY *fTellRProc) (ILHANDLE);
// Callback functions for file writing
typedef ILvoid (ILAPIENTRY *fCloseWProc)(ILHANDLE);
typedef ILHANDLE (ILAPIENTRY *fOpenWProc) (ILconst_string);
typedef ILint (ILAPIENTRY *fPutcProc) (ILubyte, ILHANDLE);
typedef ILint (ILAPIENTRY *fSeekWProc) (ILHANDLE, ILint, ILint);
typedef ILint (ILAPIENTRY *fTellWProc) (ILHANDLE);
typedef ILint (ILAPIENTRY *fWriteProc) (const void*, ILuint, ILuint, ILHANDLE);
// Callback functions for allocation and deallocation
typedef ILvoid* (ILAPIENTRY *mAlloc)(const ILuint);
typedef ILvoid (ILAPIENTRY *mFree) (const ILvoid* CONST_RESTRICT);
// Registered format procedures
typedef ILenum (ILAPIENTRY *IL_LOADPROC)(ILconst_string);
typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(ILconst_string);
// ImageLib Functions
ILAPI ILboolean ILAPIENTRY ilActiveImage(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilActiveLayer(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilApplyPal(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilApplyProfile(ILstring InProfile, ILstring OutProfile);
ILAPI ILvoid ILAPIENTRY ilBindImage(ILuint Image);
ILAPI ILboolean ILAPIENTRY ilBlit(ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth);
ILAPI ILboolean ILAPIENTRY ilBlitAlpha(ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth, ILboolean BlendAlpha);
ILAPI ILvoid ILAPIENTRY ilClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
ILAPI ILboolean ILAPIENTRY ilClearImage(ILvoid);
ILAPI ILuint ILAPIENTRY ilCloneCurImage(ILvoid);
ILAPI ILboolean ILAPIENTRY ilCompressFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilConvertImage(ILenum DestFormat, ILenum DestType);
ILAPI ILboolean ILAPIENTRY ilConvertPal(ILenum DestFormat);
ILAPI ILboolean ILAPIENTRY ilCopyImage(ILuint Src);
ILAPI ILuint ILAPIENTRY ilCopyPixels(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILuint ILAPIENTRY ilCreateSubImage(ILenum Type, ILuint Num);
ILAPI ILboolean ILAPIENTRY ilDefaultImage(ILvoid);
ILAPI ILvoid ILAPIENTRY ilDeleteImage(const ILuint Num);
ILAPI ILvoid ILAPIENTRY ilDeleteImages(ILsizei Num, const ILuint *Images);
ILAPI ILboolean ILAPIENTRY ilDisable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilEnable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilFormatFunc(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
ILAPI ILint ILAPIENTRY ilGenImage();
ILAPI ILubyte* ILAPIENTRY ilGetAlpha(ILenum Type);
ILAPI ILboolean ILAPIENTRY ilGetBoolean(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilGetBooleanv(ILenum Mode, ILboolean *Param);
ILAPI ILubyte* ILAPIENTRY ilGetData(ILvoid);
ILAPI ILuint ILAPIENTRY ilGetDXTCData(ILvoid *Buffer, ILuint BufferSize, ILenum DXTCFormat);
ILAPI ILenum ILAPIENTRY ilGetError(ILvoid);
ILAPI ILint ILAPIENTRY ilGetInteger(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILuint ILAPIENTRY ilGetLumpPos(ILvoid);
ILAPI ILubyte* ILAPIENTRY ilGetPalette(ILvoid);
ILAPI ILstring ILAPIENTRY ilGetString(ILenum StringName);
ILAPI ILvoid ILAPIENTRY ilHint(ILenum Target, ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilInit(ILvoid);
ILAPI ILboolean ILAPIENTRY ilIsDisabled(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilIsEnabled(ILenum Mode);
ILAPI ILenum ILAPIENTRY ilDetermineTypeF(ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilIsImage(ILuint Image);
ILAPI ILboolean ILAPIENTRY ilIsValid(ILenum Type, ILstring FileName);
ILAPI ILboolean ILAPIENTRY ilIsValidF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilIsValidL(ILenum Type, ILvoid *Lump, ILuint Size);
ILAPI ILvoid ILAPIENTRY ilKeyColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
ILAPI ILboolean ILAPIENTRY ilLoad(ILenum Type, ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilLoadF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilLoadImage(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilLoadL(ILenum Type, const ILvoid *Lump, ILuint Size);
ILAPI ILboolean ILAPIENTRY ilLoadPal(ILconst_string FileName);
ILAPI ILvoid ILAPIENTRY ilModAlpha( ILdouble AlphaValue );
ILAPI ILboolean ILAPIENTRY ilOriginFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilOverlayImage(ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord);
ILAPI ILvoid ILAPIENTRY ilPopAttrib(ILvoid);
ILAPI ILvoid ILAPIENTRY ilPushAttrib(ILuint Bits);
ILAPI ILvoid ILAPIENTRY ilRegisterFormat(ILenum Format);
ILAPI ILboolean ILAPIENTRY ilRegisterLoad(ILconst_string Ext, IL_LOADPROC Load);
ILAPI ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num);
ILAPI ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num);
ILAPI ILvoid ILAPIENTRY ilRegisterOrigin(ILenum Origin);
ILAPI ILvoid ILAPIENTRY ilRegisterPal(ILvoid *Pal, ILuint Size, ILenum Type);
ILAPI ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save);
ILAPI ILvoid ILAPIENTRY ilRegisterType(ILenum Type);
ILAPI ILboolean ILAPIENTRY ilRemoveLoad(ILconst_string Ext);
ILAPI ILboolean ILAPIENTRY ilRemoveSave(ILconst_string Ext);
DEPRECATED(ILAPI ILvoid ILAPIENTRY ilResetMemory(ILvoid));
ILAPI ILvoid ILAPIENTRY ilResetRead(ILvoid);
ILAPI ILvoid ILAPIENTRY ilResetWrite(ILvoid);
ILAPI ILboolean ILAPIENTRY ilSave(ILenum Type, ILstring FileName);
ILAPI ILuint ILAPIENTRY ilSaveF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilSaveImage(ILconst_string FileName);
ILAPI ILuint ILAPIENTRY ilSaveL(ILenum Type, ILvoid *Lump, ILuint Size);
ILAPI ILboolean ILAPIENTRY ilSavePal(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilSetAlpha( ILdouble AlphaValue );
ILAPI ILboolean ILAPIENTRY ilSetData(ILvoid *Data);
ILAPI ILboolean ILAPIENTRY ilSetDuration(ILuint Duration);
ILAPI ILvoid ILAPIENTRY ilSetInteger(ILenum Mode, ILint Param);
ILAPI ILvoid ILAPIENTRY ilSetMemory(mAlloc, mFree);
ILAPI ILvoid ILAPIENTRY ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILvoid ILAPIENTRY ilSetRead(fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc);
ILAPI ILvoid ILAPIENTRY ilSetString(ILenum Mode, const char *String);
ILAPI ILvoid ILAPIENTRY ilSetWrite(fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc);
ILAPI ILvoid ILAPIENTRY ilShutDown(ILvoid);
ILAPI ILboolean ILAPIENTRY ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte numChannels, ILenum Format, ILenum Type, ILvoid *Data);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilTypeFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilLoadData(ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
ILAPI ILboolean ILAPIENTRY ilLoadDataF(ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
ILAPI ILboolean ILAPIENTRY ilLoadDataL(ILvoid *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
ILAPI ILboolean ILAPIENTRY ilSaveData(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilLoadFromJpegStruct(ILvoid* JpegDecompressorPtr);
ILAPI ILboolean ILAPIENTRY ilSaveFromJpegStruct(ILvoid* JpegCompressorPtr);
// For all those weirdos that spell "colour" without the 'u'.
#define ilClearColor ilClearColour
#define ilKeyColor ilKeyColour
#ifdef __cplusplus
}
#endif
#endif // __IL_H__
#endif // __il_h__
#define imemclear(x,y) memset(x,0,y);

View File

@@ -0,0 +1,205 @@
#ifndef WRAPPER_H
#define WRAPPER_H
/*#include <il/il.h>
#include <il/ilu.h>*/
#include <IL/ilut.h> // Probably only have to #include this one
#ifdef _MSC_VER
#ifndef _IL_WRAP_BUILD_LIB
#pragma comment(lib, "il_wrap.lib")
#endif
#endif
class ilImage
{
public:
ilImage();
ilImage(char *);
ilImage(const ilImage &);
virtual ~ilImage();
ILboolean Load(char *);
ILboolean Load(char *, ILenum);
ILboolean Save(char *);
ILboolean Save(char *, ILenum);
// ImageLib functions
ILboolean ActiveImage(ILuint);
ILboolean ActiveLayer(ILuint);
ILboolean ActiveMipmap(ILuint);
ILboolean Clear(ILvoid);
ILvoid ClearColour(ILclampf, ILclampf, ILclampf, ILclampf);
ILboolean Convert(ILenum);
ILboolean Copy(ILuint);
ILboolean Default(ILvoid);
ILboolean Flip(ILvoid);
ILboolean SwapColours(ILvoid);
ILboolean Resize(ILuint, ILuint, ILuint);
ILboolean TexImage(ILuint, ILuint, ILuint, ILubyte, ILenum, ILenum, ILvoid*);
// Image handling
ILvoid Bind(ILvoid) const;
ILvoid Bind(ILuint);
ILvoid Close(ILvoid) { this->Delete(); }
ILvoid Delete(ILvoid);
ILvoid iGenBind();
ILenum PaletteAlphaIndex();
// Image characteristics
ILuint Width(ILvoid);
ILuint Height(ILvoid);
ILuint Depth(ILvoid);
ILubyte Bpp(ILvoid);
ILubyte Bitpp(ILvoid);
ILenum PaletteType(ILvoid);
ILenum Format(ILvoid);
ILenum Type(ILvoid);
ILuint NumImages(ILvoid);
ILuint NumMipmaps(ILvoid);
ILuint GetId(ILvoid) const;
ILenum GetOrigin(ILvoid);
ILubyte *GetData(ILvoid);
ILubyte *GetPalette(ILvoid);
// Rendering
ILuint BindImage(ILvoid);
ILuint BindImage(ILenum);
// Operators
ilImage& operator = (ILuint);
ilImage& operator = (const ilImage &);
protected:
ILuint Id;
private:
ILvoid iStartUp();
};
class ilFilters
{
public:
static ILboolean Alienify(ilImage &);
static ILboolean BlurAvg(ilImage &, ILuint Iter);
static ILboolean BlurGaussian(ilImage &, ILuint Iter);
static ILboolean Contrast(ilImage &, ILfloat Contrast);
static ILboolean EdgeDetectE(ilImage &);
static ILboolean EdgeDetectP(ilImage &);
static ILboolean EdgeDetectS(ilImage &);
static ILboolean Emboss(ilImage &);
static ILboolean Gamma(ilImage &, ILfloat Gamma);
static ILboolean Negative(ilImage &);
static ILboolean Noisify(ilImage &, ILubyte Factor);
static ILboolean Pixelize(ilImage &, ILuint PixSize);
static ILboolean Saturate(ilImage &, ILfloat Saturation);
static ILboolean Saturate(ilImage &, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
static ILboolean ScaleColours(ilImage &, ILfloat r, ILfloat g, ILfloat b);
static ILboolean Sharpen(ilImage &, ILfloat Factor, ILuint Iter);
};
#ifdef ILUT_USE_OPENGL
class ilOgl
{
public:
static ILvoid Init(ILvoid);
static GLuint BindTex(ilImage &);
static ILboolean Upload(ilImage &, ILuint);
static GLuint Mipmap(ilImage &);
static ILboolean Screen(ILvoid);
static ILboolean Screenie(ILvoid);
};
#endif//ILUT_USE_OPENGL
#ifdef ILUT_USE_ALLEGRO
class ilAlleg
{
public:
static ILvoid Init(ILvoid);
static BITMAP *Convert(ilImage &);
};
#endif//ILUT_USE_ALLEGRO
#ifdef ILUT_USE_WIN32
class ilWin32
{
public:
static ILvoid Init(ILvoid);
static HBITMAP Convert(ilImage &);
static ILboolean GetClipboard(ilImage &);
static ILvoid GetInfo(ilImage &, BITMAPINFO *Info);
static ILubyte *GetPadData(ilImage &);
static HPALETTE GetPal(ilImage &);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type);
static ILboolean SetClipboard(ilImage &);
};
#endif//ILUT_USE_WIN32
class ilValidate
{
public:
static ILboolean Valid(ILenum, char *);
static ILboolean Valid(ILenum, FILE *);
static ILboolean Valid(ILenum, ILvoid *, ILuint);
protected:
private:
};
class ilState
{
public:
static ILboolean Disable(ILenum);
static ILboolean Enable(ILenum);
static ILvoid Get(ILenum, ILboolean &);
static ILvoid Get(ILenum, ILint &);
static ILboolean GetBool(ILenum);
static ILint GetInt(ILenum);
static const char *GetString(ILenum);
static ILboolean IsDisabled(ILenum);
static ILboolean IsEnabled(ILenum);
static ILboolean Origin(ILenum);
static ILvoid Pop(ILvoid);
static ILvoid Push(ILuint);
protected:
private:
};
class ilError
{
public:
static ILvoid Check(ILvoid (*Callback)(const char*));
static ILvoid Check(ILvoid (*Callback)(ILenum));
static ILenum Get(ILvoid);
static const char *String(ILvoid);
static const char *String(ILenum);
protected:
private:
};
#endif//WRAPPER_H

View File

@@ -0,0 +1,180 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 06/23/2002 <--Y2K Compliant! =]
//
// Filename: IL/ilu.h
//
// Description: The main include file for ILU
//
//-----------------------------------------------------------------------------
#ifndef __ilu_h_
#ifndef __ILU_H__
#define __ilu_h_
#define __ILU_H__
#include <IL/il.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "DevILU.lib")
#endif
#endif
#endif
#define ILU_VERSION_1_6_8 1
#define ILU_VERSION 168
#define ILU_FILTER 0x2600
#define ILU_NEAREST 0x2601
#define ILU_LINEAR 0x2602
#define ILU_BILINEAR 0x2603
#define ILU_SCALE_BOX 0x2604
#define ILU_SCALE_TRIANGLE 0x2605
#define ILU_SCALE_BELL 0x2606
#define ILU_SCALE_BSPLINE 0x2607
#define ILU_SCALE_LANCZOS3 0x2608
#define ILU_SCALE_MITCHELL 0x2609
// Error types
#define ILU_INVALID_ENUM 0x0501
#define ILU_OUT_OF_MEMORY 0x0502
#define ILU_INTERNAL_ERROR 0x0504
#define ILU_INVALID_VALUE 0x0505
#define ILU_ILLEGAL_OPERATION 0x0506
#define ILU_INVALID_PARAM 0x0509
// Values
#define ILU_PLACEMENT 0x0700
#define ILU_LOWER_LEFT 0x0701
#define ILU_LOWER_RIGHT 0x0702
#define ILU_UPPER_LEFT 0x0703
#define ILU_UPPER_RIGHT 0x0704
#define ILU_CENTER 0x0705
#define ILU_CONVOLUTION_MATRIX 0x0710
#define ILU_VERSION_NUM IL_VERSION_NUM
#define ILU_VENDOR IL_VENDOR
// Filters
/*
#define ILU_FILTER_BLUR 0x0803
#define ILU_FILTER_GAUSSIAN_3x3 0x0804
#define ILU_FILTER_GAUSSIAN_5X5 0x0805
#define ILU_FILTER_EMBOSS1 0x0807
#define ILU_FILTER_EMBOSS2 0x0808
#define ILU_FILTER_LAPLACIAN1 0x080A
#define ILU_FILTER_LAPLACIAN2 0x080B
#define ILU_FILTER_LAPLACIAN3 0x080C
#define ILU_FILTER_LAPLACIAN4 0x080D
#define ILU_FILTER_SHARPEN1 0x080E
#define ILU_FILTER_SHARPEN2 0x080F
#define ILU_FILTER_SHARPEN3 0x0810
*/
typedef struct ILinfo
{
ILuint Id; // the image's id
ILubyte *Data; // the image's data
ILuint Width; // the image's width
ILuint Height; // the image's height
ILuint Depth; // the image's depth
ILubyte Bpp; // bytes per pixel (not bits) of the image
ILuint SizeOfData; // the total size of the data (in bytes)
ILenum Format; // image format (in IL enum style)
ILenum Type; // image type (in IL enum style)
ILenum Origin; // origin of the image
ILubyte *Palette; // the image's palette
ILenum PalType; // palette type
ILuint PalSize; // palette size
ILenum CubeFlags; // flags for what cube map sides are present
ILuint NumNext; // number of images following
ILuint NumMips; // number of mipmaps
ILuint NumLayers; // number of layers
} ILinfo;
typedef struct ILpointf {
ILfloat x;
ILfloat y;
} ILpointf;
typedef struct ILpointi {
ILint x;
ILint y;
} ILpointi;
ILAPI ILboolean ILAPIENTRY iluAlienify(ILvoid);
ILAPI ILboolean ILAPIENTRY iluBlurAvg(ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluBlurGaussian(ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluBuildMipmaps(ILvoid);
ILAPI ILuint ILAPIENTRY iluColoursUsed(ILvoid);
ILAPI ILboolean ILAPIENTRY iluCompareImage(ILuint Comp);
ILAPI ILboolean ILAPIENTRY iluContrast(ILfloat Contrast);
ILAPI ILboolean ILAPIENTRY iluCrop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth);
DEPRECATED(ILAPI ILvoid ILAPIENTRY iluDeleteImage(ILuint Id));
ILAPI ILboolean ILAPIENTRY iluEdgeDetectE(ILvoid);
ILAPI ILboolean ILAPIENTRY iluEdgeDetectP(ILvoid);
ILAPI ILboolean ILAPIENTRY iluEdgeDetectS(ILvoid);
ILAPI ILboolean ILAPIENTRY iluEmboss(ILvoid);
ILAPI ILboolean ILAPIENTRY iluEnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth);
ILAPI ILboolean ILAPIENTRY iluEnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim);
ILAPI ILboolean ILAPIENTRY iluEqualize(ILvoid);
ILAPI ILstring ILAPIENTRY iluErrorString(ILenum Error);
ILAPI ILboolean ILAPIENTRY iluConvolution(ILint *matrix, ILint scale, ILint bias);
ILAPI ILboolean ILAPIENTRY iluFlipImage(ILvoid);
ILAPI ILboolean ILAPIENTRY iluGammaCorrect(ILfloat Gamma);
DEPRECATED(ILAPI ILuint ILAPIENTRY iluGenImage(ILvoid));
ILAPI ILvoid ILAPIENTRY iluGetImageInfo(ILinfo *Info);
ILAPI ILint ILAPIENTRY iluGetInteger(ILenum Mode);
ILAPI ILvoid ILAPIENTRY iluGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILstring ILAPIENTRY iluGetString(ILenum StringName);
ILAPI ILvoid ILAPIENTRY iluImageParameter(ILenum PName, ILenum Param);
ILAPI ILvoid ILAPIENTRY iluInit(ILvoid);
ILAPI ILboolean ILAPIENTRY iluInvertAlpha(ILvoid);
ILAPI ILuint ILAPIENTRY iluLoadImage(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY iluMirror(ILvoid);
ILAPI ILboolean ILAPIENTRY iluNegative(ILvoid);
ILAPI ILboolean ILAPIENTRY iluNoisify(ILclampf Tolerance);
ILAPI ILboolean ILAPIENTRY iluPixelize(ILuint PixSize);
ILAPI ILvoid ILAPIENTRY iluRegionfv(ILpointf *Points, ILuint n);
ILAPI ILvoid ILAPIENTRY iluRegioniv(ILpointi *Points, ILuint n);
ILAPI ILboolean ILAPIENTRY iluReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance);
ILAPI ILboolean ILAPIENTRY iluRotate(ILfloat Angle);
ILAPI ILboolean ILAPIENTRY iluRotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
ILAPI ILboolean ILAPIENTRY iluSaturate1f(ILfloat Saturation);
ILAPI ILboolean ILAPIENTRY iluSaturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
ILAPI ILboolean ILAPIENTRY iluScale(ILuint Width, ILuint Height, ILuint Depth);
ILAPI ILboolean ILAPIENTRY iluScaleAlpha(ILfloat scale);
ILAPI ILboolean ILAPIENTRY iluScaleColours(ILfloat r, ILfloat g, ILfloat b);
ILAPI ILboolean ILAPIENTRY iluSharpen(ILfloat Factor, ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluSwapColours(ILvoid);
ILAPI ILboolean ILAPIENTRY iluWave(ILfloat Angle);
#define iluColorsUsed iluColoursUsed
#define iluSwapColors iluSwapColours
#define iluReplaceColor iluReplaceColour
#define iluScaleColor iluScaleColour
#ifdef __cplusplus
}
#endif
#endif // __ILU_H__
#endif // __ilu_h_

View File

@@ -0,0 +1,25 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 07/09/2002 <--Y2K Compliant! =]
//
// Filename: src-ILU/src/ilu_region.h
//
// Description: Creates an image region.
//
//-----------------------------------------------------------------------------
#ifndef ILU_REGION_H
#define ILU_REGION_H
typedef struct Edge
{
ILint yUpper;
ILfloat xIntersect, dxPerScan;
struct Edge *next;
} Edge;
#endif//ILU_REGION_H

View File

@@ -0,0 +1,322 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Toolkit Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 06/23/2002 <--Y2K Compliant! =]
//
// Filename: IL/ilut.h
//
// Description: The main include file for ILUT
//
//-----------------------------------------------------------------------------
#ifndef __ilut_h_
#ifndef __ILUT_H__
#define __ilut_h_
#define __ILUT_H__
#include "IL/il.h"
#include "IL/ilu.h"
//-----------------------------------------------------------------------------
// Defines
//-----------------------------------------------------------------------------
#define ILUT_VERSION_1_6_8 1
#define ILUT_VERSION 168
// Attribute Bits
#define ILUT_OPENGL_BIT 0x00000001
#define ILUT_D3D_BIT 0x00000002
#define ILUT_ALL_ATTRIB_BITS 0x000FFFFF
// Error Types
#define ILUT_INVALID_ENUM 0x0501
#define ILUT_OUT_OF_MEMORY 0x0502
#define ILUT_INVALID_VALUE 0x0505
#define ILUT_ILLEGAL_OPERATION 0x0506
#define ILUT_INVALID_PARAM 0x0509
#define ILUT_COULD_NOT_OPEN_FILE 0x050A
#define ILUT_STACK_OVERFLOW 0x050E
#define ILUT_STACK_UNDERFLOW 0x050F
#define ILUT_BAD_DIMENSIONS 0x0511
#define ILUT_NOT_SUPPORTED 0x0550
// State Definitions
#define ILUT_PALETTE_MODE 0x0600
#define ILUT_OPENGL_CONV 0x0610
#define ILUT_D3D_MIPLEVELS 0x0620
#define ILUT_MAXTEX_WIDTH 0x0630
#define ILUT_MAXTEX_HEIGHT 0x0631
#define ILUT_MAXTEX_DEPTH 0x0632
#define ILUT_GL_USE_S3TC 0x0634
#define ILUT_D3D_USE_DXTC 0x0634
#define ILUT_GL_GEN_S3TC 0x0635
#define ILUT_D3D_GEN_DXTC 0x0635
#define ILUT_S3TC_FORMAT 0x0705
#define ILUT_DXTC_FORMAT 0x0705
#define ILUT_D3D_POOL 0x0706
#define ILUT_D3D_ALPHA_KEY_COLOR 0x0707
#define ILUT_D3D_ALPHA_KEY_COLOUR 0x0707
#define ILUT_FORCE_INTEGER_FORMAT 0x0636
//This new state does automatic texture target detection
//if enabled. Currently, only cubemap detection is supported.
//if the current image is no cubemap, the 2d texture is chosen.
#define ILUT_GL_AUTODETECT_TEXTURE_TARGET 0x0807
// Values
#define ILUT_VERSION_NUM IL_VERSION_NUM
#define ILUT_VENDOR IL_VENDOR
// The different rendering api's...more to be added later?
#define ILUT_OPENGL 0
#define ILUT_ALLEGRO 1
#define ILUT_WIN32 2
#define ILUT_DIRECT3D8 3
#define ILUT_DIRECT3D9 4
/*
// Includes specific config
#ifdef DJGPP
#define ILUT_USE_ALLEGRO
#elif _WIN32_WCE
#define ILUT_USE_WIN32
#elif _WIN32
//#ifdef __GNUC__ //__CYGWIN32__ (Cygwin seems to not define this with DevIL builds)
#define ILUT_USE_WIN32
#include "IL/config.h"
// Temporary fix for the SDL main() linker bug.
//#ifdef ILUT_USE_SDL
//#undef ILUT_USE_SDL
//#endif//ILUT_USE_SDL
//#else
// #define ILUT_USE_WIN32
// #define ILUT_USE_OPENGL
// #define ILUT_USE_SDL
// #define ILUT_USE_DIRECTX8
//#endif
#elif BEOS // Don't know the #define
#define ILUT_USE_BEOS
#define ILUT_USE_OPENGL
#elif MACOSX
#define ILUT_USE_OPENGL
#else
// We are surely using a *nix so the configure script
// may have written the configured config.h header
#include "IL/config.h"
#endif
*/
#ifdef _WIN32
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "DevILUT.lib")
#endif
#endif
#endif
#include "IL/config.h"
//////////////
// Opengl
//////////////
#ifdef ILUT_USE_OPENGL
#if defined(_MSC_VER) || defined(_WIN32)
//#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif//_MSC_VER
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif//__APPLE__
#endif
#ifdef ILUT_USE_WIN32
//#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
//
// If we can avoid including these in all cases thing tend to break less
// and we can keep all of them defined as available
//
// Kriss
//
// ImageLib Utility Toolkit's Allegro Functions
#ifdef ILUT_USE_ALLEGRO
// #include <allegro.h>
#endif//ILUT_USE_ALLEGRO
#ifdef ILUT_USE_SDL
// #include <SDL.h>
#endif
#ifdef ILUT_USE_DIRECTX8
// #include <d3d8.h>
#endif//ILUT_USE_DIRECTX9
#ifdef ILUT_USE_DIRECTX9
// #include <d3d9.h>
#endif//ILUT_USE_DIRECTX9
//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// ImageLib Utility Toolkit Functions
ILAPI ILboolean ILAPIENTRY ilutDisable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutEnable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutGetBoolean(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilutGetBooleanv(ILenum Mode, ILboolean *Param);
ILAPI ILint ILAPIENTRY ilutGetInteger(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilutGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILstring ILAPIENTRY ilutGetString(ILenum StringName);
ILAPI ILvoid ILAPIENTRY ilutInit(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutIsDisabled(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutIsEnabled(ILenum Mode);
ILAPI ILvoid ILAPIENTRY ilutPopAttrib(ILvoid);
ILAPI ILvoid ILAPIENTRY ilutPushAttrib(ILuint Bits);
ILAPI ILvoid ILAPIENTRY ilutSetInteger(ILenum Mode, ILint Param);
ILAPI ILboolean ILAPIENTRY ilutRenderer(ILenum Renderer);
// ImageLib Utility Toolkit's OpenGL Functions
#ifdef ILUT_USE_OPENGL
ILAPI GLuint ILAPIENTRY ilutGLBindTexImage();
ILAPI GLuint ILAPIENTRY ilutGLBindMipmaps(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutGLBuildMipmaps(ILvoid);
ILAPI GLuint ILAPIENTRY ilutGLLoadImage(ILstring FileName);
ILAPI ILboolean ILAPIENTRY ilutGLScreen(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutGLScreenie(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutGLSaveImage(ILstring FileName, GLuint TexID);
ILAPI ILboolean ILAPIENTRY ilutGLSetTex(GLuint TexID);
ILAPI ILboolean ILAPIENTRY ilutGLTexImage(GLuint Level);
ILAPI ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff);
#endif//ILUT_USE_OPENGL
// ImageLib Utility Toolkit's Allegro Functions
#ifdef ILUT_USE_ALLEGRO
#ifdef __cplusplus
}
#endif
#include <allegro.h>
#ifdef __cplusplus
extern "C" {
#endif
ILAPI BITMAP* ILAPIENTRY ilutAllegLoadImage(ILstring FileName);
ILAPI BITMAP* ILAPIENTRY ilutConvertToAlleg(PALETTE Pal);
#endif//ILUT_USE_ALLEGRO
// ImageLib Utility Toolkit's SDL Functions
#ifdef ILUT_USE_SDL
ILAPI struct SDL_Surface* ILAPIENTRY ilutConvertToSDLSurface(unsigned int flags);
ILAPI struct SDL_Surface* ILAPIENTRY ilutSDLSurfaceLoadImage(ILstring FileName);
ILAPI ILboolean ILAPIENTRY ilutSDLSurfaceFromBitmap(struct SDL_Surface *Bitmap);
#endif//ILUT_USE_SDL
// ImageLib Utility Toolkit's BeOS Functions
#ifdef ILUT_USE_BEOS
ILAPI BBitmap ILAPIENTRY ilutConvertToBBitmap(ILvoid);
#endif//ILUT_USE_BEOS
// ImageLib Utility Toolkit's Win32 GDI Functions
#ifdef ILUT_USE_WIN32
ILAPI HBITMAP ILAPIENTRY ilutConvertToHBitmap(HDC hDC);
ILAPI HBITMAP ILAPIENTRY ilutConvertSliceToHBitmap(HDC hDC, ILuint slice);
ILAPI ILvoid ILAPIENTRY ilutFreePaddedData(ILubyte *Data);
ILAPI ILvoid ILAPIENTRY ilutGetBmpInfo(BITMAPINFO *Info);
ILAPI HPALETTE ILAPIENTRY ilutGetHPal(ILvoid);
ILAPI ILubyte* ILAPIENTRY ilutGetPaddedData(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutGetWinClipboard(ILvoid);
ILAPI ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, ILstring ResourceType, ILenum Type);
ILAPI ILboolean ILAPIENTRY ilutSetHBitmap(HBITMAP Bitmap);
ILAPI ILboolean ILAPIENTRY ilutSetHPal(HPALETTE Pal);
ILAPI ILboolean ILAPIENTRY ilutSetWinClipboard(ILvoid);
ILAPI HBITMAP ILAPIENTRY ilutWinLoadImage(ILstring FileName, HDC hDC);
ILAPI ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url);
ILAPI ILboolean ILAPIENTRY ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, HDC hDC);
ILAPI ILboolean ILAPIENTRY ilutWinSaveImage(ILstring FileName, HBITMAP Bitmap);
#endif//ILUT_USE_WIN32
// ImageLib Utility Toolkit's DirectX 8 Functions
#ifdef ILUT_USE_DIRECTX8
// ILAPI ILvoid ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
ILAPI struct IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(struct IDirect3DDevice8 *Device);
ILAPI struct IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(struct IDirect3DDevice8 *Device);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DVolumeTexture8 **Texture);
// These two are not tested yet.
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(struct IDirect3DDevice8 *Device, struct IDirect3DSurface8 *Surface);
#endif//ILUT_USE_DIRECTX8
#ifdef ILUT_USE_DIRECTX9
// ILAPI ILvoid ILAPIENTRY ilutD3D9MipFunc(ILuint NumLevels);
ILAPI struct IDirect3DTexture9* ILAPIENTRY ilutD3D9Texture (struct IDirect3DDevice9* Device);
ILAPI struct IDirect3DVolumeTexture9* ILAPIENTRY ilutD3D9VolumeTexture (struct IDirect3DDevice9* Device);
ILAPI struct IDirect3DCubeTexture9* ILAPIENTRY ilutD3D9CubeTexture (struct IDirect3DDevice9* Device);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DVolumeTexture9 **Texture);
// These two are not tested yet.
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9LoadSurface(struct IDirect3DDevice9 *Device, struct IDirect3DSurface9 *Surface);
#endif//ILUT_USE_DIRECTX9
#ifdef __cplusplus
}
#endif
#endif // __ILUT_H__
#endif // __ilut_h_

View File

@@ -0,0 +1,34 @@
/*
* altivec_typeconversion.h
* DevIL
*
* Created by Meloni Dario on 17/04/05.
*
*/
#include "il_internal.h"
#ifdef ALTIVEC_GCC
#ifndef ALTIVEC_COMMON
#define ALTIVEC_COMMON
typedef union {
vector unsigned int vuint;
unsigned int suint[4];
vector unsigned char vuchar;
unsigned char suchar[4];
vector float vf;
float sf[4];
} vector_t;
// Loads 16 byte from the specified address, aligned or not
//vector unsigned char load_unaligned( unsigned char *buffer );
// Fills a vector with the specified value
vector float fill_vector_f( float value );
#define eround(v,x) (((int)((v/x)*10)%10) > 0 ? (v/x) : (v/x)+1)
#define eround16(v) eround(v,16)
#endif
#endif

View File

@@ -0,0 +1,28 @@
/*
* altivec_typeconversion.h
* DevIL
*
* Created by Meloni Dario on 24/04/05.
*
*/
#include "altivec_common.h"
#ifdef ALTIVEC_GCC
// data and newdata may be the same buffer
// Used to convert RGB <-> BGR in various data types
void abc2cba_byte( ILubyte *data, ILuint length, ILubyte *newdata );
void abc2cba_short( ILushort *data, ILuint length, ILushort *newdata );
void abc2cba_int( ILuint *data, ILuint length, ILuint *newdata );
#define abc2cba_float(x,y,z) abc2cba_int(((ILuint*)(x)),y,((ILuint*)(z)))
void abc2cba_double( ILdouble *data, ILuint length, ILdouble *newdata );
// Used to convert RGBA <-> BGRA in various data types
void abcd2cbad_byte( ILubyte *data, ILuint length, ILubyte *newdata );
void abcd2cbad_short( ILushort *data, ILuint length, ILushort *newdata );
void abcd2cbad_int( ILuint *data, ILuint length, ILuint *newdata );
#define abcd2cbad_float(x,y,z) abcd2cbad_int(((ILuint*)(x)),y,((ILuint*)(z)))
void abcd2cbad_double( ILdouble *data, ILuint length, ILdouble *newdata );
#endif

View File

@@ -0,0 +1,41 @@
#ifndef ALLOC_H
#define ALLOC_H
/*#if defined(_WIN32) && defined(_MEM_DEBUG)
void *c_alloc(unsigned long size, unsigned long num, const char *file, unsigned long line);
void *m_alloc(unsigned long size, const char *file, unsigned long line);
void f_ree(void *ptr);
#ifdef malloc
#undef malloc
#endif
#ifdef calloc
#undef calloc
#endif
#ifdef free
#undef free
#endif
#define malloc(size) m_alloc(size, __FILE__, __LINE__)
#define calloc(size, num) c_alloc(size, num, __FILE__, __LINE__)
#define free(addr) f_ree(addr)
#endif//defined(_WIN32) && defined(_MEM_DEBUG)*/
#if defined (__ALLOC_C)
#define __ALLOC_EXTERN
#else
#define __ALLOC_EXTERN extern
#endif
#include <IL/il.h>
__ALLOC_EXTERN mAlloc ialloc_ptr;
__ALLOC_EXTERN mFree ifree_ptr;
#endif//ALLOC_H

View File

@@ -0,0 +1,43 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_bits.h
//
// Description: Implements a file class that reads/writes bits directly.
//
//-----------------------------------------------------------------------------
#ifndef BITS_H
#define BITS_H
#include "il_internal.h"
// Struct for dealing with reading bits from a file
typedef struct BITFILE
{
ILHANDLE File;
ILuint BitPos;
ILint ByteBitOff;
ILubyte Buff;
} BITFILE;
// Functions for reading bits from a file
//BITFILE* bopen(const char *FileName, const char *Mode);
ILint bclose(BITFILE *BitFile);
BITFILE* bfile(ILHANDLE File);
ILint btell(BITFILE *BitFile);
ILint bseek(BITFILE *BitFile, ILuint Offset, ILuint Mode);
ILint bread(ILvoid *Buffer, ILuint Size, ILuint Number, BITFILE *BitFile);
//ILint bwrite(ILvoid *Buffer, ILuint Size, ILuint Number, BITFILE *BitFile);
// Useful macros for manipulating bits
#define SetBits(var, bits) (var |= bits)
#define ClearBits(var, bits) (var &= ~(bits))
#endif//BITS_H

View File

@@ -0,0 +1,107 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 09/01/2003 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_bmp.h
//
// Description: Reads and writes to a bitmap (.bmp) file.
//
//-----------------------------------------------------------------------------
#ifndef BMP_H
#define BMP_H
#include "il_internal.h"
#ifdef _WIN32
#pragma pack(push, bmp_struct, 1)
#endif
typedef struct BMPHEAD {
ILushort bfType;
ILint bfSize;
ILuint bfReserved;
ILint bfDataOff;
ILint biSize;
ILint biWidth;
ILint biHeight;
ILshort biPlanes;
ILshort biBitCount;
ILint biCompression;
ILint biSizeImage;
ILint biXPelsPerMeter;
ILint biYPelsPerMeter;
ILint biClrUsed;
ILint biClrImportant;
} IL_PACKSTRUCT BMPHEAD;
typedef struct OS2_HEAD
{
// Bitmap file header.
ILushort bfType;
ILuint biSize;
ILshort xHotspot;
ILshort yHotspot;
ILuint DataOff;
// Bitmap core header.
ILuint cbFix;
//2003-09-01: changed cx, cy to ushort according to MSDN
ILushort cx;
ILushort cy;
ILushort cPlanes;
ILushort cBitCount;
} IL_PACKSTRUCT OS2_HEAD;
#ifdef _WIN32
#pragma pack(pop, bmp_struct)
#endif
// Internal functions
ILboolean iGetBmpHead(BMPHEAD * const Header);
ILboolean iGetOS2Head(OS2_HEAD * const Header);
ILboolean iIsValidBmp();
ILboolean iCheckBmp(const BMPHEAD *CONST_RESTRICT Header);
ILboolean iCheckOS2(const OS2_HEAD *CONST_RESTRICT Header);
ILboolean iLoadBitmapInternal();
ILboolean iSaveBitmapInternal();
ILboolean ilReadUncompBmp(BMPHEAD *Info);
ILboolean ilReadRLE8Bmp(BMPHEAD *Info);
ILboolean ilReadRLE4Bmp(BMPHEAD *Info);
ILboolean iGetOS2Bmp(OS2_HEAD *Header);
#ifdef IL_BMP_C
#undef NOINLINE
#undef INLINE
#define INLINE
#endif
#ifndef NOINLINE
INLINE ILvoid GetShiftFromMask(const ILuint Mask, ILuint * CONST_RESTRICT ShiftLeft, ILuint * CONST_RESTRICT ShiftRight) {
ILuint Temp, i;
if( Mask == 0 ) {
*ShiftLeft = *ShiftRight = 0;
return;
}
Temp = Mask;
for( i = 0; i < 32; i++, Temp >>= 1 ) {
if( Temp & 1 )
break;
}
*ShiftRight = i;
// Temp is preserved, so use it again:
for( i = 0; i < 8; i++, Temp >>= 1 ) {
if( !(Temp & 1) )
break;
}
*ShiftLeft = 8 - i;
return;
}
#endif
#endif//BMP_H

View File

@@ -0,0 +1,52 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 12/03/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_dcx.h
//
// Description: Reads from a .dcx file.
//
//-----------------------------------------------------------------------------
#ifndef DCX_H
#define DCX_H
#include "il_internal.h"
#ifdef _WIN32
#pragma pack(push, packed_struct, 1)
#endif
typedef struct DCXHEAD
{
ILubyte Manufacturer;
ILubyte Version;
ILubyte Encoding;
ILubyte Bpp;
ILushort Xmin, Ymin, Xmax, Ymax;
ILushort HDpi;
ILushort VDpi;
ILubyte ColMap[48];
ILubyte Reserved;
ILubyte NumPlanes;
ILushort Bps;
ILushort PaletteInfo;
ILushort HScreenSize;
ILushort VScreenSize;
ILubyte Filler[54];
} IL_PACKSTRUCT DCXHEAD;
#ifdef _WIN32
#pragma pack(pop, packed_struct)
#endif
// For checking and reading
ILboolean iIsValidDcx(ILvoid);
ILboolean iCheckDcx(DCXHEAD *Header);
ILboolean iLoadDcxInternal(ILvoid);
ILimage* iUncompressDcx(DCXHEAD *Header);
ILimage* iUncompressDcxSmall(DCXHEAD *Header);
#endif//PCX_H

View File

@@ -0,0 +1,214 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 02/21/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_dds.h
//
// Description: Reads from a DirectDraw Surface (.dds) file.
//
//-----------------------------------------------------------------------------
#ifndef DDS_H
#define DDS_H
#include "il_internal.h"
#ifdef _WIN32
#pragma pack(push, dds_struct, 1)
#endif
typedef struct DDSHEAD
{
ILbyte Signature[4];
ILuint Size1; // size of the structure (minus MagicNum)
ILuint Flags1; // determines what fields are valid
ILuint Height; // height of surface to be created
ILuint Width; // width of input surface
ILuint LinearSize; // Formless late-allocated optimized surface size
ILuint Depth; // Depth if a volume texture
ILuint MipMapCount; // number of mip-map levels requested
ILuint AlphaBitDepth; // depth of alpha buffer requested
ILuint NotUsed[10];
ILuint Size2; // size of structure
ILuint Flags2; // pixel format flags
ILuint FourCC; // (FOURCC code)
ILuint RGBBitCount; // how many bits per pixel
ILuint RBitMask; // mask for red bit
ILuint GBitMask; // mask for green bits
ILuint BBitMask; // mask for blue bits
ILuint RGBAlphaBitMask; // mask for alpha channel
ILuint ddsCaps1, ddsCaps2, ddsCaps3, ddsCaps4; // direct draw surface capabilities
ILuint TextureStage;
} IL_PACKSTRUCT DDSHEAD;
#ifdef _WIN32
#pragma pack(pop, dds_struct)
#endif
// use cast to struct instead of RGBA_MAKE as struct is
// much
typedef struct Color8888
{
ILubyte r; // change the order of names to change the
ILubyte g; // order of the output ARGB or BGRA, etc...
ILubyte b; // Last one is MSB, 1st is LSB.
ILubyte a;
} Color8888;
typedef struct Color888
{
ILubyte r; // change the order of names to change the
ILubyte g; // order of the output ARGB or BGRA, etc...
ILubyte b; // Last one is MSB, 1st is LSB.
} Color888;
typedef struct Color565
{
unsigned nBlue : 5; // order of names changes
unsigned nGreen : 6; // byte order of output to 32 bit
unsigned nRed : 5;
} Color565;
typedef struct DXTColBlock
{
ILshort col0;
ILshort col1;
// no bit fields - use bytes
ILbyte row[4];
} DXTColBlock;
typedef struct DXTAlphaBlockExplicit
{
ILshort row[4];
} DXTAlphaBlockExplicit;
typedef struct DXTAlphaBlock3BitLinear
{
ILbyte alpha0;
ILbyte alpha1;
ILbyte stuff[6];
} DXTAlphaBlock3BitLinear;
// Defines
//Those 4 were added on 20040516 to make
//the written dds files more standard compliant
#define DDS_CAPS 0x00000001L
#define DDS_HEIGHT 0x00000002L
#define DDS_WIDTH 0x00000004L
#define DDS_RGB 0x00000040L
#define DDS_PIXELFORMAT 0x00001000L
#define DDS_LUMINANCE 0x00020000L
#define DDS_ALPHAPIXELS 0x00000001L
#define DDS_ALPHA 0x00000002L
#define DDS_FOURCC 0x00000004L
#define DDS_PITCH 0x00000008L
#define DDS_COMPLEX 0x00000008L
#define DDS_TEXTURE 0x00001000L
#define DDS_MIPMAPCOUNT 0x00020000L
#define DDS_LINEARSIZE 0x00080000L
#define DDS_VOLUME 0x00200000L
#define DDS_MIPMAP 0x00400000L
#define DDS_DEPTH 0x00800000L
#define DDS_CUBEMAP 0x00000200L
#define DDS_CUBEMAP_POSITIVEX 0x00000400L
#define DDS_CUBEMAP_NEGATIVEX 0x00000800L
#define DDS_CUBEMAP_POSITIVEY 0x00001000L
#define DDS_CUBEMAP_NEGATIVEY 0x00002000L
#define DDS_CUBEMAP_POSITIVEZ 0x00004000L
#define DDS_CUBEMAP_NEGATIVEZ 0x00008000L
#define IL_MAKEFOURCC(ch0, ch1, ch2, ch3) \
((ILint)(ILbyte)(ch0) | ((ILint)(ILbyte)(ch1) << 8) | \
((ILint)(ILbyte)(ch2) << 16) | ((ILint)(ILbyte)(ch3) << 24 ))
enum PixFormat
{
PF_ARGB,
PF_RGB,
PF_DXT1,
PF_DXT2,
PF_DXT3,
PF_DXT4,
PF_DXT5,
PF_3DC,
PF_ATI1N,
PF_LUMINANCE,
PF_LUMINANCE_ALPHA,
PF_RXGB, //Doom3 normal maps
PF_A16B16G16R16,
PF_R16F,
PF_G16R16F,
PF_A16B16G16R16F,
PF_R32F,
PF_G32R32F,
PF_A32B32G32R32F,
PF_UNKNOWN = 0xFF
};
#define CUBEMAP_SIDES 6
// Internal functions
ILboolean iLoadDdsInternal(ILvoid);
ILboolean iIsValidDds(ILvoid);
ILboolean iCheckDds(DDSHEAD *Head);
ILvoid AdjustVolumeTexture(DDSHEAD *Head);
ILboolean ReadData(ILvoid);
ILboolean AllocImage(ILvoid);
ILboolean Decompress(ILvoid);
ILboolean ReadMipmaps(ILvoid);
ILuint DecodePixelFormat(ILvoid);
ILboolean DecompressARGB(ILvoid);
ILboolean DecompressDXT1(ILvoid);
ILboolean DecompressDXT2(ILvoid);
ILboolean DecompressDXT3(ILvoid);
ILboolean DecompressDXT4(ILvoid);
ILboolean DecompressDXT5(ILvoid);
ILboolean Decompress3Dc(ILvoid);
ILboolean DecompressAti1n(ILvoid);
ILboolean DecompressRXGB(ILvoid);
ILboolean DecompressFloat(ILvoid);
ILvoid CorrectPreMult(ILvoid);
ILvoid GetBitsFromMask(ILuint Mask, ILuint *ShiftLeft, ILuint *ShiftRight);
ILboolean iSaveDdsInternal(ILvoid);
ILboolean WriteHeader(ILimage *Image, ILenum DXTCFormat, ILuint CubeFlags);
ILushort *CompressTo565(ILimage *Image);
ILubyte *CompressTo88(ILimage *Image);
ILuint Compress(ILimage *Image, ILenum DXTCFormat);
ILboolean GetBlock(ILushort *Block, ILushort *Data, ILimage *Image, ILuint XPos, ILuint YPos);

View File

@@ -0,0 +1,276 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_doompal.h
//
// Description: The default Doom palette
//
//-----------------------------------------------------------------------------
#ifndef DOOMPAL_H
#define DOOMPAL_H
#define IL_DOOMPAL_SIZE 768
ILubyte ilDefaultDoomPal[IL_DOOMPAL_SIZE] = {
0, 0, 0,
31, 23, 11,
23, 15, 7,
75, 75, 75,
255, 255, 255,
27, 27, 27,
19, 19, 19,
11, 11, 11,
7, 7, 7,
47, 55, 31,
35, 43, 15,
23, 31, 7,
15, 23, 0,
79, 59, 43,
71, 51, 35,
63, 43, 27,
255, 183, 183,
247, 171, 171,
243, 163, 163,
235, 151, 151,
231, 143, 143,
223, 135, 135,
219, 123, 123,
211, 115, 115,
203, 107, 107,
199, 99, 99,
191, 91, 91,
187, 87, 87,
179, 79, 79,
175, 71, 71,
167, 63, 63,
163, 59, 59,
155, 51, 51,
151, 47, 47,
143, 43, 43,
139, 35, 35,
131, 31, 31,
127, 27, 27,
119, 23, 23,
115, 19, 19,
107, 15, 15,
103, 11, 11,
95, 7, 7,
91, 7, 7,
83, 7, 7,
79, 0, 0,
71, 0, 0,
67, 0, 0,
255, 235, 223,
255, 227, 211,
255, 219, 199,
255, 211, 187,
255, 207, 179,
255, 199, 167,
255, 191, 155,
255, 187, 147,
255, 179, 131,
247, 171, 123,
239, 163, 115,
231, 155, 107,
223, 147, 99,
215, 139, 91,
207, 131, 83,
203, 127, 79,
191, 123, 75,
179, 115, 71,
171, 111, 67,
163, 107, 63,
155, 99, 59,
143, 95, 55,
135, 87, 51,
127, 83, 47,
119, 79, 43,
107, 71, 39,
95, 67, 35,
83, 63, 31,
75, 55, 27,
63, 47, 23,
51, 43, 19,
43, 35, 15,
239, 239, 239,
231, 231, 231,
223, 223, 223,
219, 219, 219,
211, 211, 211,
203, 203, 203,
199, 199, 199,
191, 191, 191,
183, 183, 183,
179, 179, 179,
171, 171, 171,
167, 167, 167,
159, 159, 159,
151, 151, 151,
147, 147, 147,
139, 139, 139,
131, 131, 131,
127, 127, 127,
119, 119, 119,
111, 111, 111,
107, 107, 107,
99, 99, 99,
91, 91, 91,
87, 87, 87,
79, 79, 79,
71, 71, 71,
67, 67, 67,
59, 59, 59,
55, 55, 55,
47, 47, 47,
39, 39, 39,
35, 35, 35,
119, 255, 111,
111, 239, 103,
103, 223, 95,
95, 207, 87,
91, 191, 79,
83, 175, 71,
75, 159, 63,
67, 147, 55,
63, 131, 47,
55, 115, 43,
47, 99, 35,
39, 83, 27,
31, 67, 23,
23, 51, 15,
19, 35, 11,
11, 23, 7,
191, 167, 143,
183, 159, 135,
175, 151, 127,
167, 143, 119,
159, 135, 111,
155, 127, 107,
147, 123, 99,
139, 115, 91,
131, 107, 87,
123, 99, 79,
119, 95, 75,
111, 87, 67,
103, 83, 63,
95, 75, 55,
87, 67, 51,
83, 63, 47,
159, 131, 99,
143, 119, 83,
131, 107, 75,
119, 95, 63,
103, 83, 51,
91, 71, 43,
79, 59, 35,
67, 51, 27,
123, 127, 99,
111, 115, 87,
103, 107, 79,
91, 99, 71,
83, 87, 59,
71, 79, 51,
63, 71, 43,
55, 63, 39,
255, 255, 115,
235, 219, 87,
215, 187, 67,
195, 155, 47,
175, 123, 31,
155, 91, 19,
135, 67, 7,
115, 43, 0,
255, 255, 255,
255, 219, 219,
255, 187, 187,
255, 155, 155,
255, 123, 123,
255, 95, 95,
255, 63, 63,
255, 31, 31,
255, 0, 0,
239, 0, 0,
227, 0, 0,
215, 0, 0,
203, 0, 0,
191, 0, 0,
179, 0, 0,
167, 0, 0,
155, 0, 0,
139, 0, 0,
127, 0, 0,
115, 0, 0,
103, 0, 0,
91, 0, 0,
79, 0, 0,
67, 0, 0,
231, 231, 255,
199, 199, 255,
171, 171, 255,
143, 143, 255,
115, 115, 255,
83, 83, 255,
55, 55, 255,
27, 27, 255,
0, 0, 255,
0, 0, 227,
0, 0, 203,
0, 0, 179,
0, 0, 155,
0, 0, 131,
0, 0, 107,
0, 0, 83,
255, 255, 255,
255, 235, 219,
255, 215, 187,
255, 199, 155,
255, 179, 123,
255, 163, 91,
255, 143, 59,
255, 127, 27,
243, 115, 23,
235, 111, 15,
223, 103, 15,
215, 95, 11,
203, 87, 7,
195, 79, 0,
183, 71, 0,
175, 67, 0,
255, 255, 255,
255, 255, 215,
255, 255, 179,
255, 255, 143,
255, 255, 107,
255, 255, 71,
255, 255, 35,
255, 255, 0,
167, 63, 0,
159, 55, 0,
147, 47, 0,
135, 35, 0,
79, 59, 39,
67, 47, 27,
55, 35, 19,
47, 27, 11,
0, 0, 83,
0, 0, 71,
0, 0, 59,
0, 0, 47,
0, 0, 35,
0, 0, 23,
0, 0, 11,
0, 255, 255,
255, 159, 67,
255, 231, 75,
255, 123, 255,
255, 0, 255,
207, 0, 207,
159, 0, 155,
111, 0, 107,
167, 107, 107
};
#endif//DOOMPAL_H

View File

@@ -0,0 +1,377 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 01/29/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_endian.h
//
// Description: Handles Endian-ness
//
//-----------------------------------------------------------------------------
#ifndef IL_ENDIAN_H
#define IL_ENDIAN_H
#include "il_internal.h"
#ifdef WORDS_BIGENDIAN //this is defined by ./configure
#ifndef __BIG_ENDIAN__
#define __BIG_ENDIAN__
#endif
#endif
#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \
|| (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__))
#undef __LITTLE_ENDIAN__
#define Short(s) iSwapShort(s)
#define UShort(s) iSwapUShort(s)
#define Int(i) iSwapInt(i)
#define UInt(i) iSwapUInt(i)
#define Float(f) iSwapFloat(f)
#define Double(d) iSwapDouble(d)
#define BigShort(s)
#define BigUShort(s)
#define BigInt(i)
#define BigUInt(i)
#define BigFloat(f)
#define BigDouble(d)
#else
#undef __BIG_ENDIAN__
#undef __LITTLE_ENDIAN__ // Not sure if it's defined by any compiler...
#define __LITTLE_ENDIAN__
#define Short(s)
#define UShort(s)
#define Int(i)
#define UInt(i)
#define Float(f)
#define Double(d)
#define BigShort(s) iSwapShort(s)
#define BigUShort(s) iSwapUShort(s)
#define BigInt(i) iSwapInt(i)
#define BigUInt(i) iSwapUInt(i)
#define BigFloat(f) iSwapFloat(f)
#define BigDouble(d) iSwapDouble(d)
#endif
ILvoid iSwapUShort(ILushort *s);
ILvoid iSwapShort(ILshort *s);
ILvoid iSwapUInt(ILuint *i);
ILvoid iSwapInt(ILint *i);
ILvoid iSwapFloat(ILfloat *f);
ILvoid iSwapDouble(ILdouble *d);
ILushort GetLittleUShort();
ILshort GetLittleShort();
ILuint GetLittleUInt();
ILint GetLittleInt();
ILfloat GetLittleFloat();
ILdouble GetLittleDouble();
ILushort GetBigUShort();
ILshort GetBigShort();
ILuint GetBigUInt();
ILint GetBigInt();
ILfloat GetBigFloat();
ILdouble GetBigDouble();
ILubyte SaveLittleUShort(ILushort s);
ILubyte SaveLittleShort(ILshort s);
ILubyte SaveLittleUInt(ILuint i);
ILubyte SaveLittleInt(ILint i);
ILubyte SaveLittleFloat(ILfloat f);
ILubyte SaveLittleDouble(ILdouble d);
ILubyte SaveBigUShort(ILushort s);
ILubyte SaveBigShort(ILshort s);
ILubyte SaveBigUInt(ILuint i);
ILubyte SaveBigInt(ILint i);
ILubyte SaveBigFloat(ILfloat f);
ILubyte SaveBigDouble(ILdouble d);
#ifdef IL_ENDIAN_C
#undef NOINLINE
#undef INLINE
#define INLINE
#endif
#ifndef NOINLINE
INLINE ILvoid iSwapUShort(ILushort *s) {
#ifdef USE_WIN32_ASM
__asm {
mov ebx, s
mov al, [ebx+1]
mov ah, [ebx ]
mov [ebx], ax
}
#else
#ifdef GCC_X86_ASM
asm("ror $8,%0"
:
: "r" (*s) );
#else
*s = ((*s)>>8) | ((*s)<<8);
#endif //GCC_X86_ASM
#endif //USE_WIN32_ASM
}
INLINE ILvoid iSwapShort(ILshort *s) {
iSwapUShort((ILushort*)s);
}
INLINE ILvoid iSwapUInt(ILuint *i) {
#ifdef USE_WIN32_ASM
__asm {
mov ebx, i
mov eax, [ebx]
bswap eax
mov [ebx], eax
}
#else
#ifdef GCC_X86_ASM
asm("bswap %0;"
: "=r" (*i) );
#else
*i = ((*i)>>24) | (((*i)>>8) & 0xff00) | (((*i)<<8) & 0xff0000) | ((*i)<<24);
#endif //GCC_X86_ASM
#endif //USE_WIN32_ASM
}
INLINE ILvoid iSwapInt(ILint *i) {
iSwapUInt((ILuint*)i);
}
INLINE ILvoid iSwapFloat(ILfloat *f) {
iSwapUInt((ILuint*)f);
}
INLINE ILvoid iSwapDouble(ILdouble *d) {
#ifdef GCC_X86_ASM
int *t = (int*)d;
asm("bswap %2 \n"
"bswap %3 \n"
"movl %2,%1 \n"
"movl %3,%0 \n"
: "=g" (t[0]), "=g" (t[1])
: "r" (t[0]), "r" (t[1]));
#else
ILubyte t,*b = (ILubyte*)d;
#define dswap(x,y) t=b[x];b[x]=b[y];b[y]=b[x];
dswap(0,7);
dswap(1,6);
dswap(2,5);
dswap(3,4);
#undef dswap
#endif
}
INLINE ILushort GetLittleUShort() {
ILushort s;
iread(&s, sizeof(ILushort), 1);
#ifdef __BIG_ENDIAN__
iSwapUShort(&s);
#endif
return s;
}
INLINE ILshort GetLittleShort() {
ILshort s;
iread(&s, sizeof(ILshort), 1);
#ifdef __BIG_ENDIAN__
iSwapShort(&s);
#endif
return s;
}
INLINE ILuint GetLittleUInt() {
ILuint i;
iread(&i, sizeof(ILuint), 1);
#ifdef __BIG_ENDIAN__
iSwapUInt(&i);
#endif
return i;
}
INLINE ILint GetLittleInt() {
ILint i;
iread(&i, sizeof(ILint), 1);
#ifdef __BIG_ENDIAN__
iSwapInt(&i);
#endif
return i;
}
INLINE ILfloat GetLittleFloat() {
ILfloat f;
iread(&f, sizeof(ILfloat), 1);
#ifdef __BIG_ENDIAN__
iSwapFloat(&f);
#endif
return f;
}
INLINE ILdouble GetLittleDouble() {
ILdouble d;
iread(&d, sizeof(ILdouble), 1);
#ifdef __BIG_ENDIAN__
iSwapDouble(&d);
#endif
return d;
}
INLINE ILushort GetBigUShort() {
ILushort s;
iread(&s, sizeof(ILushort), 1);
#ifdef __LITTLE_ENDIAN__
iSwapUShort(&s);
#endif
return s;
}
INLINE ILshort GetBigShort() {
ILshort s;
iread(&s, sizeof(ILshort), 1);
#ifdef __LITTLE_ENDIAN__
iSwapShort(&s);
#endif
return s;
}
INLINE ILuint GetBigUInt() {
ILuint i;
iread(&i, sizeof(ILuint), 1);
#ifdef __LITTLE_ENDIAN__
iSwapUInt(&i);
#endif
return i;
}
INLINE ILint GetBigInt() {
ILint i;
iread(&i, sizeof(ILint), 1);
#ifdef __LITTLE_ENDIAN__
iSwapInt(&i);
#endif
return i;
}
INLINE ILfloat GetBigFloat() {
ILfloat f;
iread(&f, sizeof(ILfloat), 1);
#ifdef __LITTLE_ENDIAN__
iSwapFloat(&f);
#endif
return f;
}
INLINE ILdouble GetBigDouble() {
ILdouble d;
iread(&d, sizeof(ILdouble), 1);
#ifdef __LITTLE_ENDIAN__
iSwapDouble(&d);
#endif
return d;
}
INLINE ILubyte SaveLittleUShort(ILushort s) {
#ifdef __BIG_ENDIAN__
iSwapUShort(&s);
#endif
return iwrite(&s, sizeof(ILushort), 1);
}
INLINE ILubyte SaveLittleShort(ILshort s) {
#ifdef __BIG_ENDIAN__
iSwapShort(&s);
#endif
return iwrite(&s, sizeof(ILshort), 1);
}
INLINE ILubyte SaveLittleUInt(ILuint i) {
#ifdef __BIG_ENDIAN__
iSwapUInt(&i);
#endif
return iwrite(&i, sizeof(ILuint), 1);
}
INLINE ILubyte SaveLittleInt(ILint i) {
#ifdef __BIG_ENDIAN__
iSwapInt(&i);
#endif
return iwrite(&i, sizeof(ILint), 1);
}
INLINE ILubyte SaveLittleFloat(ILfloat f) {
#ifdef __BIG_ENDIAN__
iSwapFloat(&f);
#endif
return iwrite(&f, sizeof(ILfloat), 1);
}
INLINE ILubyte SaveLittleDouble(ILdouble d) {
#ifdef __BIG_ENDIAN__
iSwapDouble(&d);
#endif
return iwrite(&d, sizeof(ILdouble), 1);
}
INLINE ILubyte SaveBigUShort(ILushort s) {
#ifdef __LITTLE_ENDIAN__
iSwapUShort(&s);
#endif
return iwrite(&s, sizeof(ILushort), 1);
}
INLINE ILubyte SaveBigShort(ILshort s) {
#ifdef __LITTLE_ENDIAN__
iSwapShort(&s);
#endif
return iwrite(&s, sizeof(ILshort), 1);
}
INLINE ILubyte SaveBigUInt(ILuint i) {
#ifdef __LITTLE_ENDIAN__
iSwapUInt(&i);
#endif
return iwrite(&i, sizeof(ILuint), 1);
}
INLINE ILubyte SaveBigInt(ILint i) {
#ifdef __LITTLE_ENDIAN__
iSwapInt(&i);
#endif
return iwrite(&i, sizeof(ILint), 1);
}
INLINE ILubyte SaveBigFloat(ILfloat f) {
#ifdef __LITTLE_ENDIAN__
iSwapFloat(&f);
#endif
return iwrite(&f, sizeof(ILfloat), 1);
}
INLINE ILubyte SaveBigDouble(ILdouble d) {
#ifdef __LITTLE_ENDIAN__
iSwapDouble(&d);
#endif
return iwrite(&d, sizeof(ILdouble), 1);
}
#endif
ILvoid EndianSwapData(void *_Image);
#endif//ENDIAN_H

View File

@@ -0,0 +1,76 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 10/20/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_files.h
//
// Description: File handling for DevIL
//
//-----------------------------------------------------------------------------
#ifndef FILES_H
#define FILES_H
#if defined (__FILES_C)
#define __FILES_EXTERN
#else
#define __FILES_EXTERN extern
#endif
#include <IL/il.h>
__FILES_EXTERN ILvoid ILAPIENTRY iPreserveReadFuncs(ILvoid);
__FILES_EXTERN ILvoid ILAPIENTRY iRestoreReadFuncs(ILvoid);
__FILES_EXTERN fEofProc EofProc;
__FILES_EXTERN fGetcProc GetcProc;
__FILES_EXTERN fReadProc ReadProc;
__FILES_EXTERN fSeekRProc SeekRProc;
__FILES_EXTERN fSeekWProc SeekWProc;
__FILES_EXTERN fTellRProc TellRProc;
__FILES_EXTERN fTellWProc TellWProc;
__FILES_EXTERN fPutcProc PutcProc;
__FILES_EXTERN fWriteProc WriteProc;
__FILES_EXTERN ILHANDLE ILAPIENTRY iDefaultOpen(ILconst_string FileName);
__FILES_EXTERN ILvoid ILAPIENTRY iDefaultClose(ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultGetc(ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultRead(ILvoid *Buffer, ILuint Size, ILuint Number, ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultSeekR(ILHANDLE Handle, ILint Offset, ILint Mode);
__FILES_EXTERN ILint ILAPIENTRY iDefaultSeekW(ILHANDLE Handle, ILint Offset, ILint Mode);
__FILES_EXTERN ILint ILAPIENTRY iDefaultTellR(ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultTellW(ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultPutc(ILubyte Char, ILHANDLE Handle);
__FILES_EXTERN ILint ILAPIENTRY iDefaultWrite(const ILvoid *Buffer, ILuint Size, ILuint Number, ILHANDLE Handle);
__FILES_EXTERN ILvoid iSetInputFile(ILHANDLE File);
__FILES_EXTERN ILvoid iSetInputLump(const ILvoid *Lump, ILuint Size);
__FILES_EXTERN ILboolean (ILAPIENTRY *ieof)(ILvoid);
__FILES_EXTERN ILHANDLE (ILAPIENTRY *iopenr)(ILconst_string);
__FILES_EXTERN ILvoid (ILAPIENTRY *icloser)(ILHANDLE);
__FILES_EXTERN ILint (ILAPIENTRY *igetc)(ILvoid);
__FILES_EXTERN ILuint (ILAPIENTRY *iread)(ILvoid *Buffer, ILuint Size, ILuint Number);
__FILES_EXTERN ILuint (ILAPIENTRY *iseek)(ILint Offset, ILuint Mode);
__FILES_EXTERN ILuint (ILAPIENTRY *itell)(ILvoid);
__FILES_EXTERN ILvoid iSetOutputFile(ILHANDLE File);
__FILES_EXTERN ILvoid iSetOutputLump(ILvoid *Lump, ILuint Size);
__FILES_EXTERN ILvoid (ILAPIENTRY *iclosew)(ILHANDLE);
__FILES_EXTERN ILHANDLE (ILAPIENTRY *iopenw)(ILconst_string);
__FILES_EXTERN ILint (ILAPIENTRY *iputc)(ILubyte Char);
__FILES_EXTERN ILuint (ILAPIENTRY *iseekw)(ILint Offset, ILuint Mode);
__FILES_EXTERN ILuint (ILAPIENTRY *itellw)(ILvoid);
__FILES_EXTERN ILint (ILAPIENTRY *iwrite)(const ILvoid *Buffer, ILuint Size, ILuint Number);
__FILES_EXTERN ILHANDLE ILAPIENTRY iGetFile(ILvoid);
__FILES_EXTERN const ILubyte* ILAPIENTRY iGetLump(ILvoid);
__FILES_EXTERN ILuint ILAPIENTRY ilprintf(const char *, ...);
__FILES_EXTERN ILvoid ipad(ILuint NumZeros);
__FILES_EXTERN ILboolean iPreCache(ILuint Size);
__FILES_EXTERN ILvoid iUnCache(ILvoid);
#endif//FILES_H

View File

@@ -0,0 +1,71 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/18/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_gif.h
//
// Description: Reads from a Graphics Interchange Format (.gif) file.
//
//-----------------------------------------------------------------------------
#ifndef GIF_H
#define GIF_H
#include "il_internal.h"
#define GIF87A 87
#define GIF89A 89
#ifdef _WIN32
#pragma pack(push, gif_struct, 1)
#endif
typedef struct GIFHEAD
{
char Sig[6];
ILushort Width;
ILushort Height;
ILubyte ColourInfo;
ILubyte Background;
ILubyte Aspect;
} IL_PACKSTRUCT GIFHEAD;
typedef struct IMAGEDESC
{
ILubyte Separator;
ILushort OffX;
ILushort OffY;
ILushort Width;
ILushort Height;
ILubyte ImageInfo;
} IL_PACKSTRUCT IMAGEDESC;
typedef struct GFXCONTROL
{
ILubyte Size;
ILubyte Packed;
ILushort Delay;
ILubyte Transparent;
ILubyte Terminator;
ILboolean Used; //this stores if a gfxcontrol was read - it is IL_FALSE (!)
//if a gfxcontrol was read from the file, IL_TRUE otherwise
} IL_PACKSTRUCT GFXCONTROL;
#ifdef _WIN32
#pragma pack(pop, gif_struct)
#endif
// Internal functions
ILboolean iLoadGifInternal(ILvoid);
ILboolean ilLoadGifF(ILHANDLE File);
ILboolean iIsValidGif(ILvoid);
ILboolean iGetPalette(ILubyte Info, ILpal *Pal);
ILboolean GetImages(ILpal *GlobalPal, GIFHEAD *GifHead);
ILboolean SkipExtensions(GFXCONTROL *Gfx);
ILboolean GifGetData(ILubyte *Data, ILuint ImageSize, ILuint Width, ILuint Height, ILuint Stride, GFXCONTROL *Gfx);
ILboolean RemoveInterlace(ILimage *image);
ILboolean iCopyPalette(ILpal *Dest, ILpal *Src);
ILboolean ConvertTransparent(ILimage *Image, ILubyte TransColour);

View File

@@ -0,0 +1,42 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2004 by Denton Woods (this file by thakis)
// Last modified: 06/09/2004
//
// Filename: src-IL/include/il_hdr.h
//
// Description: Reads a RADIANCE High Dynamic Range Image
//
//-----------------------------------------------------------------------------
#ifndef HDR_H
#define HDR_H
#include "il_internal.h"
#ifdef _WIN32
#pragma pack(push, gif_struct, 1)
#endif
typedef struct HDRHEADER
{
char Signature[10]; //must be "#?RADIANCE"
ILuint Width, Height;
} IL_PACKSTRUCT HDRHEADER;
#ifdef _WIN32
#pragma pack(pop, gif_struct)
#endif
// Internal functions
ILboolean ilIsValidHdrF(ILHANDLE file);
ILboolean iIsValidHdr();
ILboolean iCheckHdr(HDRHEADER *Header);
ILboolean ilLoadHdrF(ILHANDLE file);
ILboolean iLoadHdrInternal();
ILvoid ReadScanline(ILubyte *scanline, ILuint w);
#endif//HDR_H

View File

@@ -0,0 +1,71 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_icon.h
//
// Description: Reads from a Windows icon (.ico) file.
//
//-----------------------------------------------------------------------------
#ifndef ICON_H
#define ICON_H
#include "il_internal.h"
ILboolean iLoadIconInternal();
#ifdef _WIN32
#pragma pack(push, ico_struct, 1)
#endif
typedef struct ICODIR
{
ILshort Reserved; // Reserved (must be 0)
ILshort Type; // Type (1 for icons, 2 for cursors)
ILshort Count; // How many different images?
} IL_PACKSTRUCT ICODIR;
typedef struct ICODIRENTRY
{
ILubyte Width; // Width, in pixels
ILubyte Height; // Height, in pixels
ILubyte NumColours; // Number of colors in image (0 if >=8bpp)
ILubyte Reserved; // Reserved (must be 0)
ILshort Planes; // Colour planes
ILshort Bpp; // Bits per pixel
ILuint SizeOfData; // How many bytes in this resource?
ILuint Offset; // Offset from beginning of the file
} IL_PACKSTRUCT ICODIRENTRY;
typedef struct INFOHEAD
{
ILint Size;
ILint Width;
ILint Height;
ILshort Planes;
ILshort BitCount;
ILint Compression;
ILint SizeImage;
ILint XPixPerMeter;
ILint YPixPerMeter;
ILint ColourUsed;
ILint ColourImportant;
} IL_PACKSTRUCT INFOHEAD;
typedef struct ICOIMAGE
{
INFOHEAD Head;
ILubyte *Pal; // Palette
ILubyte *Data; // XOR mask
ILubyte *AND; // AND mask
} ICOIMAGE;
#ifdef _WIN32
#pragma pack(pop, ico_struct)
#endif
#endif//ICON_H

View File

@@ -0,0 +1,380 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 02/19/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_internal.h
//
// Description: Internal stuff for DevIL
//
//-----------------------------------------------------------------------------
#ifndef INTERNAL_H
#define INTERNAL_H
#define _IL_BUILD_LIBRARY
// Standard headers
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
// Local headers
#if defined(_WIN32) && !defined(HAVE_CONFIG_H)
#define HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
#include <IL/config.h>
#endif
#include <IL/il.h>
#include <IL/devil_internal_exports.h>
#include "il_files.h"
#include "il_endian.h"
// Windows-specific
#ifdef _WIN32
#ifdef _MSC_VER
#if _MSC_VER > 1000
#pragma once
#pragma intrinsic(memcpy)
#pragma intrinsic(memset)
#pragma intrinsic(strcmp)
#pragma intrinsic(strlen)
#pragma intrinsic(strcpy)
/*
#if _MSC_VER >= 1300 // Erroneous size_t conversion warnings
pragma warning(disable : 4267)
#endif
pragma comment(linker, "/NODEFAULTLIB:libc")
pragma comment(linker, "/NODEFAULTLIB:libcd")
pragma comment(linker, "/NODEFAULTLIB:libcmt.lib")
#ifdef _DEBUG
pragma comment(linker, "/NODEFAULTLIB:libcmtd")
pragma comment(linker, "/NODEFAULTLIB:msvcrt.lib")
#endif // _DEBUG
*/
#endif // _MSC_VER > 1000
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#endif
// Windows has a TEXT macro defined in WinNT.h that makes string Unicode if UNICODE is defined.
/*#ifndef _WIN32
#define IL_TEXT(s) s
#endif*/
/*#ifdef _WIN32_WCE
#define IL_TEXT(s) ((char*)TEXT(s))
#elif _WIN32
#define IL_TEXT(s) (s)
#else
#define IL_TEXT(s) (s)
#define TEXT(s) (s)
#endif*/
#ifdef _UNICODE
#define IL_TEXT(s) L##s
#else
#define IL_TEXT(s) (s)
#endif
#ifdef IL_INLINE_ASM
#ifdef _MSC_VER // MSVC++ only
#define USE_WIN32_ASM
#endif
#endif
extern ILimage *iCurImage;
#define BIT_0 0x00000001
#define BIT_1 0x00000002
#define BIT_2 0x00000004
#define BIT_3 0x00000008
#define BIT_4 0x00000010
#define BIT_5 0x00000020
#define BIT_6 0x00000040
#define BIT_7 0x00000080
#define BIT_8 0x00000100
#define BIT_9 0x00000200
#define BIT_10 0x00000400
#define BIT_11 0x00000800
#define BIT_12 0x00001000
#define BIT_13 0x00002000
#define BIT_14 0x00004000
#define BIT_15 0x00008000
#define BIT_16 0x00010000
#define BIT_17 0x00020000
#define BIT_18 0x00040000
#define BIT_19 0x00080000
#define BIT_20 0x00100000
#define BIT_21 0x00200000
#define BIT_22 0x00400000
#define BIT_23 0x00800000
#define BIT_24 0x01000000
#define BIT_25 0x02000000
#define BIT_26 0x04000000
#define BIT_27 0x08000000
#define BIT_28 0x10000000
#define BIT_29 0x20000000
#define BIT_30 0x40000000
#define BIT_31 0x80000000
#define NUL '\0' // Easier to type and ?portable?
#if !_WIN32 || _WIN32_WCE
int stricmp(const char *src1, const char *src2);
int strnicmp(const char *src1, const char *src2, size_t max);
#endif//_WIN32
int iStrCmp(ILconst_string src1, ILconst_string src2);
//
// Some math functions
//
// A fast integer squareroot, completely accurate for x < 289.
// Taken from http://atoms.org.uk/sqrt/
// There is also a version that is accurate for all integers
// < 2^31, if we should need it
int iSqrt(int x);
//
// Useful miscellaneous functions
//
ILboolean iCheckExtension(ILconst_string Arg, ILconst_string Ext);
ILbyte* iFgets(char *buffer, ILuint maxlen);
ILboolean iFileExists(ILconst_string FileName);
ILstring iGetExtension(ILconst_string FileName);
char* ilStrDup(const char *Str);
ILuint ilStrLen(const char *Str);
// Miscellaneous functions
ILvoid ilDefaultStates(ILvoid);
ILenum iGetHint(ILenum Target);
ILint iGetInt(ILenum Mode);
ILvoid ilRemoveRegistered(ILvoid);
ILAPI ILvoid ILAPIENTRY ilSetCurImage(ILimage *Image);
//
// Rle compression
//
#define IL_TGACOMP 0x01
#define IL_PCXCOMP 0x02
#define IL_SGICOMP 0x03
#define IL_BMPCOMP 0x04
ILboolean ilRleCompressLine(ILubyte *ScanLine, ILuint Width, ILubyte Bpp, ILubyte *Dest, ILuint *DestWidth, ILenum CompressMode);
ILuint ilRleCompress(ILubyte *Data, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte *Dest, ILenum CompressMode, ILuint *ScanTable);
ILvoid iSetImage0(ILvoid);
// Conversion functions
ILboolean ilAddAlpha(ILvoid);
ILboolean ilAddAlphaKey(ILimage *Image);
ILboolean iFastConvert(ILenum DestFormat);
ILboolean ilFixImage(ILvoid);
ILboolean ilRemoveAlpha(ILvoid);
ILboolean ilSwapColours(ILvoid);
// Miscellaneous functions
char *iGetString(ILenum StringName); // Internal version of ilGetString
// Library usage
#if _MSC_VER && !_WIN32_WCE
#ifndef IL_NO_JPG
#ifdef IL_USE_IJL
//pragma comment(lib, "ijl15.lib")
#else
#ifndef IL_DEBUG
//pragma comment(lib, "libjpeg.lib")
#else
//ragma comment(lib, "debug/libjpeg.lib")
#endif
#endif
#endif
#ifndef IL_NO_MNG
#ifndef IL_DEBUG
//pragma comment(lib, "libmng.lib")
//pragma comment(lib, "libjpeg.lib") // For JNG support.
#else
//pragma comment(lib, "debug/libmng.lib")
//pragma comment(lib, "debug/libjpeg.lib") // For JNG support.
#endif
#endif
#ifndef IL_NO_PNG
#ifndef IL_DEBUG
//pragma comment(lib, "libpng.lib")
#else
//pragma comment(lib, "debug/libpng.lib")
#endif
#endif
#ifndef IL_NO_TIF
#ifndef IL_DEBUG
//pragma comment(lib, "libtiff.lib")
#else
//pragma comment(lib, "debug/libtiff.lib")
#endif
#endif
#if !defined(IL_NO_MNG) || !defined(IL_NO_PNG)
#ifndef IL_DEBUG
//pragma comment(lib, "zlib.lib")
#else
//pragma comment(lib, "debug/zlib.lib")
#endif
#endif
#endif
//
// Image loading/saving functions
//
ILboolean ilIsValidBmp(ILconst_string FileName);
ILboolean ilIsValidBmpF(ILHANDLE File);
ILboolean ilIsValidBmpL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadBmp(ILconst_string FileName);
ILboolean ilLoadBmpF(ILHANDLE File);
ILboolean ilLoadBmpL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveBmp(ILconst_string FileName);
ILboolean ilSaveBmpF(ILHANDLE File);
ILboolean ilSaveBmpL(ILvoid *Lump, ILuint Size);
ILboolean ilSaveCHeader(ILconst_string FileName, const char *InternalName);
ILboolean ilLoadCut(ILconst_string FileName);
ILboolean ilLoadCutF(ILHANDLE File);
ILboolean ilLoadCutL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidDcx(ILconst_string FileName);
ILboolean ilIsValidDcxF(ILHANDLE File);
ILboolean ilIsValidDcxL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadDcx(ILconst_string FileName);
ILboolean ilLoadDcxF(ILHANDLE File);
ILboolean ilLoadDcxL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidDds(ILconst_string FileName);
ILboolean ilIsValidDdsF(ILHANDLE File);
ILboolean ilIsValidDdsL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadDds(ILconst_string FileName);
ILboolean ilLoadDdsF(ILHANDLE File);
ILboolean ilLoadDdsL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveDds(ILconst_string FileName);
ILboolean ilSaveDdsF(ILHANDLE File);
ILboolean ilSaveDdsL(ILvoid *Lump, ILuint Size);
ILboolean ilLoadDoom(ILconst_string FileName);
ILboolean ilLoadDoomF(ILHANDLE File);
ILboolean ilLoadDoomL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadDoomFlat(ILconst_string FileName);
ILboolean ilLoadDoomFlatF(ILHANDLE File);
ILboolean ilLoadDoomFlatL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidGif(ILconst_string FileName);
ILboolean ilIsValidGifF(ILHANDLE File);
ILboolean ilIsValidGifL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadGif(ILconst_string FileName);
ILboolean ilLoadGifF(ILHANDLE File);
ILboolean ilLoadGifL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidHdr(ILconst_string FileName);
ILboolean ilIsValidHdrF(ILHANDLE File);
ILboolean ilIsValidHdrL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadHdr(ILconst_string FileName);
ILboolean ilLoadHdrF(ILHANDLE File);
ILboolean ilLoadHdrL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadIcon(ILconst_string FileName);
ILboolean ilLoadIconF(ILHANDLE File);
ILboolean ilLoadIconL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidJpg(ILconst_string FileName);
ILboolean ilIsValidJpgF(ILHANDLE File);
ILboolean ilIsValidJpgL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadJpeg(ILconst_string FileName);
ILboolean ilLoadJpegF(ILHANDLE File);
ILboolean ilLoadJpegL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveJpeg(ILconst_string FileName);
ILboolean ilSaveJpegF(ILHANDLE File);
ILboolean ilSaveJpegL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidLif(ILconst_string FileName);
ILboolean ilIsValidLifF(ILHANDLE File);
ILboolean ilIsValidLifL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadLif(ILconst_string FileName);
ILboolean ilLoadLifF(ILHANDLE File);
ILboolean ilLoadLifL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadMdl(ILconst_string FileName);
ILboolean ilLoadMdlF(ILHANDLE File);
ILboolean ilLoadMdlL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadMng(ILconst_string FileName);
ILboolean ilLoadMngF(ILHANDLE File);
ILboolean ilLoadMngL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveMng(ILconst_string FileName);
ILboolean ilSaveMngF(ILHANDLE File);
ILboolean ilSaveMngL(ILvoid *Lump, ILuint Size);
ILboolean ilLoadPcd(ILconst_string FileName);
ILboolean ilLoadPcdF(ILHANDLE File);
ILboolean ilLoadPcdL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPcx(ILconst_string FileName);
ILboolean ilIsValidPcxF(ILHANDLE File);
ILboolean ilIsValidPcxL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPcx(ILconst_string FileName);
ILboolean ilLoadPcxF(ILHANDLE File);
ILboolean ilLoadPcxL(const ILvoid *Lump, ILuint Size);
ILboolean ilSavePcx(ILconst_string FileName);
ILboolean ilSavePcxF(ILHANDLE File);
ILboolean ilSavePcxL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPic(ILconst_string FileName);
ILboolean ilIsValidPicF(ILHANDLE File);
ILboolean ilIsValidPicL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPic(ILconst_string FileName);
ILboolean ilLoadPicF(ILHANDLE File);
ILboolean ilLoadPicL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPix(ILconst_string FileName);
ILboolean ilLoadPixF(ILHANDLE File);
ILboolean ilLoadPixL(const ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPng(ILconst_string FileName);
ILboolean ilIsValidPngF(ILHANDLE File);
ILboolean ilIsValidPngL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPng(ILconst_string FileName);
ILboolean ilLoadPngF(ILHANDLE File);
ILboolean ilLoadPngL(const ILvoid *Lump, ILuint Size);
ILboolean ilSavePng(ILconst_string FileName);
ILboolean ilSavePngF(ILHANDLE File);
ILboolean ilSavePngL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPnm(ILconst_string FileName);
ILboolean ilIsValidPnmF(ILHANDLE File);
ILboolean ilIsValidPnmL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPnm(ILconst_string FileName);
ILboolean ilLoadPnmF(ILHANDLE File);
ILboolean ilLoadPnmL(const ILvoid *Lump, ILuint Size);
ILboolean ilSavePnm(ILconst_string FileName);
ILboolean ilSavePnmF(ILHANDLE File);
ILboolean ilSavePnmL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPsd(ILconst_string FileName);
ILboolean ilIsValidPsdF(ILHANDLE File);
ILboolean ilIsValidPsdL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPsd(ILconst_string FileName);
ILboolean ilLoadPsdF(ILHANDLE File);
ILboolean ilLoadPsdL(const ILvoid *Lump, ILuint Size);
ILboolean ilSavePsd(ILconst_string FileName);
ILboolean ilSavePsdF(ILHANDLE File);
ILboolean ilSavePsdL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidPsp(ILconst_string FileName);
ILboolean ilIsValidPspF(ILHANDLE File);
ILboolean ilIsValidPspL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPsp(ILconst_string FileName);
ILboolean ilLoadPspF(ILHANDLE File);
ILboolean ilLoadPspL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadPxr(ILconst_string FileName);
ILboolean ilLoadPxrF(ILHANDLE File);
ILboolean ilLoadPxrL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadRaw(ILconst_string FileName);
ILboolean ilLoadRawF(ILHANDLE File);
ILboolean ilLoadRawL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveRaw(ILconst_string FileName);
ILboolean ilSaveRawF(ILHANDLE File);
ILboolean ilSaveRawL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidSgi(ILconst_string FileName);
ILboolean ilIsValidSgiF(ILHANDLE File);
ILboolean ilIsValidSgiL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadSgi(ILconst_string FileName);
ILboolean ilLoadSgiF(ILHANDLE File);
ILboolean ilLoadSgiL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveSgi(ILconst_string FileName);
ILboolean ilSaveSgiF(ILHANDLE File);
ILboolean ilSaveSgiL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidTga(ILconst_string FileName);
ILboolean ilIsValidTgaF(ILHANDLE File);
ILboolean ilIsValidTgaL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadTarga(ILconst_string FileName);
ILboolean ilLoadTargaF(ILHANDLE File);
ILboolean ilLoadTargaL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveTarga(ILconst_string FileName);
ILboolean ilSaveTargaF(ILHANDLE File);
ILboolean ilSaveTargaL(ILvoid *Lump, ILuint Size);
ILboolean ilIsValidTiff(ILconst_string FileName);
ILboolean ilIsValidTiffF(ILHANDLE File);
ILboolean ilIsValidTiffL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadTiff(ILconst_string FileName);
ILboolean ilLoadTiffF(ILHANDLE File);
ILboolean ilLoadTiffL(const ILvoid *Lump, ILuint Size);
ILboolean ilSaveTiff(ILconst_string FileName);
ILboolean ilSaveTiffF(ILHANDLE File);
ILboolean ilSaveTiffL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadWal(ILconst_string FileName);
ILboolean ilLoadWalF(ILHANDLE File);
ILboolean ilLoadWalL(const ILvoid *Lump, ILuint Size);
ILboolean ilLoadXpm(ILconst_string FileName);
ILboolean ilLoadXpmF(ILHANDLE File);
ILboolean ilLoadXpmL(const ILvoid *Lump, ILuint Size);
#endif//INTERNAL_H

View File

@@ -0,0 +1,29 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 02/16/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_jpeg.h
//
// Description: Jpeg (.jpg) functions
//
//-----------------------------------------------------------------------------
#ifndef JPEG_H
#define JPEG_H
#include "il_internal.h"
ILboolean iCheckJpg(ILubyte Header[2]);
ILboolean iIsValidJpg(ILvoid);
#ifndef IL_USE_IJL
ILboolean iLoadJpegInternal(ILvoid);
ILboolean iSaveJpegInternal(ILvoid);
#else
ILboolean iLoadJpegInternal(ILconst_string FileName, ILvoid *Lump, ILuint Size);
ILboolean iSaveJpegInternal(ILconst_string FileName, ILvoid *Lump, ILuint Size);
#endif
#endif//JPEG_H

View File

@@ -0,0 +1,37 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2001 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_lif.c
//
// Description: Reads a Homeworld image.
//
//-----------------------------------------------------------------------------
#ifndef LIF_H
#define LIF_H
#include "il_internal.h"
typedef struct LIF_HEAD
{
char Id[8]; //"Willy 7"
ILuint Version; // Version Number (260)
ILuint Flags; // Usually 50
ILuint Width;
ILuint Height;
ILuint PaletteCRC; // CRC of palettes for fast comparison.
ILuint ImageCRC; // CRC of the image.
ILuint PalOffset; // Offset to the palette (not used).
ILuint TeamEffect0; // Team effect offset 0
ILuint TeamEffect1; // Team effect offset 1
} LIF_HEAD;
ILboolean iIsValidLif(ILvoid);
ILboolean iCheckLif(LIF_HEAD *Header);
ILboolean iLoadLifInternal(ILvoid);
#endif//LIF_H

View File

@@ -0,0 +1,242 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2001-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_manip.h
//
// Description: Image manipulation
//
//-----------------------------------------------------------------------------
#ifndef MANIP_H
#define MANIP_H
#ifdef _cplusplus
extern "C" {
#endif
ILboolean ilFlipImage(ILvoid);
ILboolean ilMirrorImage(ILvoid); //@JASON New routine created 03/28/2001
//-----------------------------------------------
// Overflow handler for float-to-half conversion;
// generates a hardware floating-point overflow,
// which may be trapped by the operating system.
//-----------------------------------------------
#ifndef NOINLINE
INLINE ILfloat ILAPIENTRY ilFloatToHalfOverflow() {
ILfloat f = 1e10;
ILint j;
for (j = 0; j < 10; j++)
f *= f; // this will overflow before
// the for loop terminates
return f;
}
//-----------------------------------------------------
// Float-to-half conversion -- general case, including
// zeroes, denormalized numbers and exponent overflows.
//-----------------------------------------------------
INLINE ILushort ILAPIENTRY ilFloatToHalf(ILuint i) {
//
// Our floating point number, f, is represented by the bit
// pattern in integer i. Disassemble that bit pattern into
// the sign, s, the exponent, e, and the significand, m.
// Shift s into the position where it will go in in the
// resulting half number.
// Adjust e, accounting for the different exponent bias
// of float and half (127 versus 15).
//
register int s = (i >> 16) & 0x00008000;
register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
register int m = i & 0x007fffff;
//
// Now reassemble s, e and m into a half:
//
if (e <= 0)
{
if (e < -10)
{
//
// E is less than -10. The absolute value of f is
// less than HALF_MIN (f may be a small normalized
// float, a denormalized float or a zero).
//
// We convert f to a half zero.
//
return 0;
}
//
// E is between -10 and 0. F is a normalized float,
// whose magnitude is less than HALF_NRM_MIN.
//
// We convert f to a denormalized half.
//
m = (m | 0x00800000) >> (1 - e);
//
// Round to nearest, round "0.5" up.
//
// Rounding may cause the significand to overflow and make
// our number normalized. Because of the way a half's bits
// are laid out, we don't have to treat this case separately;
// the code below will handle it correctly.
//
if (m & 0x00001000)
m += 0x00002000;
//
// Assemble the half from s, e (zero) and m.
//
return s | (m >> 13);
}
else if (e == 0xff - (127 - 15))
{
if (m == 0)
{
//
// F is an infinity; convert f to a half
// infinity with the same sign as f.
//
return s | 0x7c00;
}
else
{
//
// F is a NAN; we produce a half NAN that preserves
// the sign bit and the 10 leftmost bits of the
// significand of f, with one exception: If the 10
// leftmost bits are all zero, the NAN would turn
// into an infinity, so we have to set at least one
// bit in the significand.
//
m >>= 13;
return s | 0x7c00 | m | (m == 0);
}
}
else
{
//
// E is greater than zero. F is a normalized float.
// We try to convert f to a normalized half.
//
//
// Round to nearest, round "0.5" up
//
if (m & 0x00001000)
{
m += 0x00002000;
if (m & 0x00800000)
{
m = 0; // overflow in significand,
e += 1; // adjust exponent
}
}
//
// Handle exponent overflow
//
if (e > 30)
{
ilFloatToHalfOverflow(); // Cause a hardware floating point overflow;
return s | 0x7c00; // if this returns, the half becomes an
} // infinity with the same sign as f.
//
// Assemble the half from s, e and m.
//
return s | (e << 10) | (m >> 13);
}
}
//stolen from OpenEXR
INLINE ILuint ILAPIENTRY ilHalfToFloat (ILushort y) {
int s = (y >> 15) & 0x00000001;
int e = (y >> 10) & 0x0000001f;
int m = y & 0x000003ff;
if (e == 0)
{
if (m == 0)
{
//
// Plus or minus zero
//
return s << 31;
}
else
{
//
// Denormalized number -- renormalize it
//
while (!(m & 0x00000400))
{
m <<= 1;
e -= 1;
}
e += 1;
m &= ~0x00000400;
}
}
else if (e == 31)
{
if (m == 0)
{
//
// Positive or negative infinity
//
return (s << 31) | 0x7f800000;
}
else
{
//
// Nan -- preserve sign and significand bits
//
return (s << 31) | 0x7f800000 | (m << 13);
}
}
//
// Normalized number
//
e = e + (127 - 15);
m = m << 13;
//
// Assemble s, e and m.
//
return (s << 31) | (e << 23) | m;
}
#endif //NOINLINE
#ifdef _cplusplus
}
#endif
#endif//MANIP_H

View File

@@ -0,0 +1,28 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_mdl.h
//
// Description: Reads a Half-Life model file.
//
//-----------------------------------------------------------------------------
#ifndef MD2_H
#define MD2_H
#include "il_internal.h"
typedef struct TEX_HEAD
{
char Name[64];
ILuint Flags;
ILuint Width;
ILuint Height;
ILuint Offset;
} TEX_HEAD;
#endif//MD2_H

View File

@@ -0,0 +1,54 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_pal.h
//
// Description: Loads palettes from different file formats
//
//-----------------------------------------------------------------------------
#ifndef IL_PAL_H
#define IL_PAL_H
#include "il_internal.h"
#define BUFFLEN 256
#define PALBPP 3
#ifdef _MSC_VER
#pragma pack(push, packed_struct, 1)
#endif
typedef struct HALOHEAD
{
ILushort Id; // 'AH'
ILshort Version;
ILshort Size;
ILbyte Filetype;
ILbyte Subtype;
//ILshort Brdid, Grmode;
ILint Ignored;
ILushort MaxIndex; // Colors = maxindex + 1
ILushort MaxRed;
ILushort MaxGreen;
ILushort MaxBlue;
/*ILbyte Signature[8];
ILbyte Filler[12];*/
ILbyte Filler[20]; // Always 0 by PSP 4
} IL_PACKSTRUCT HALOHEAD;
#ifdef _MSC_VER
#pragma pack(pop, packed_struct)
#endif
ILboolean ilLoadJascPal(ILconst_string FileName);
ILboolean ilSaveJascPal(ILconst_string FileName);
char *iFgetw(ILubyte *Buff, ILint MaxLen, FILE *File);
ILboolean ilLoadHaloPal(ILconst_string FileName);
ILboolean ilLoadColPal(ILconst_string FileName);
ILboolean ilLoadActPal(ILconst_string FileName);
ILboolean ilLoadPltPal(ILconst_string FileName);
#endif//IL_PAL_H

View File

@@ -0,0 +1,58 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_pcx.h
//
// Description: Reads and writes from/to a .pcx file.
//
//-----------------------------------------------------------------------------
#ifndef PCX_H
#define PCX_H
#include "il_internal.h"
#ifdef _WIN32
#pragma pack(push, packed_struct, 1)
#endif
typedef struct PCXHEAD
{
ILubyte Manufacturer;
ILubyte Version;
ILubyte Encoding;
ILubyte Bpp;
ILushort Xmin, Ymin, Xmax, Ymax;
ILushort HDpi;
ILushort VDpi;
ILubyte ColMap[48];
ILubyte Reserved;
ILubyte NumPlanes;
ILushort Bps;
ILushort PaletteInfo;
ILushort HScreenSize;
ILushort VScreenSize;
ILubyte Filler[54];
} IL_PACKSTRUCT PCXHEAD;
#ifdef _WIN32
#pragma pack(pop, packed_struct)
#endif
// For checking and reading
ILboolean iIsValidPcx(ILvoid);
ILboolean iCheckPcx(PCXHEAD *Header);
ILboolean iLoadPcxInternal(ILvoid);
ILboolean iSavePcxInternal(ILvoid);
ILboolean iUncompressPcx(PCXHEAD *Header);
ILboolean iUncompressSmall(PCXHEAD *Header);
// For writing
ILuint encput(ILubyte byt, ILubyte cnt);
ILuint encLine(ILubyte *inBuff, ILint inLen, ILubyte Stride);
#endif//PCX_H

View File

@@ -0,0 +1,79 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/21/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_pic.h
//
// Description: Softimage Pic (.pic) functions
//
//-----------------------------------------------------------------------------
#ifndef PIC_H
#define PIC_H
#include "il_internal.h"
#ifdef _MSC_VER
#pragma pack(push, packed_struct, 1)
#endif
typedef struct PIC_HEAD
{
ILint Magic; // PIC_MAGIC_NUMBER
ILfloat Version; // Version of format
ILbyte Comment[80]; // Prototype description
ILbyte Id[4]; // 'PICT'
ILshort Width; // Image width, in pixels
ILshort Height; // Image height, in pixels
ILfloat Ratio; // Pixel aspect ratio
ILshort Fields; // Picture field type
ILshort Padding; // Unused
} IL_PACKSTRUCT PIC_HEAD;
typedef struct CHANNEL
{
ILubyte Size;
ILubyte Type;
ILubyte Chan;
ILvoid *Next;
} CHANNEL;
#ifdef _MSC_VER
#pragma pack(pop, packed_struct)
#endif
// Data type
#define PIC_UNSIGNED_INTEGER 0x00
#define PIC_SIGNED_INTEGER 0x10 // XXX: Not implemented
#define PIC_SIGNED_FLOAT 0x20 // XXX: Not implemented
// Compression type
#define PIC_UNCOMPRESSED 0x00
#define PIC_PURE_RUN_LENGTH 0x01
#define PIC_MIXED_RUN_LENGTH 0x02
// CHANNEL types (OR'd)
#define PIC_RED_CHANNEL 0x80
#define PIC_GREEN_CHANNEL 0x40
#define PIC_BLUE_CHANNEL 0x20
#define PIC_ALPHA_CHANNEL 0x10
#define PIC_SHADOW_CHANNEL 0x08 // XXX: Not implemented
#define PIC_DEPTH_CHANNEL 0x04 // XXX: Not implemented
#define PIC_AUXILIARY_1_CHANNEL 0x02 // XXX: Not implemented
#define PIC_AUXILIARY_2_CHANNEL 0x01 // XXX: Not implemented
ILboolean iIsValidPic(ILvoid);
ILboolean iCheckPic(PIC_HEAD *Header);
ILboolean iLoadPicInternal(ILvoid);
ILboolean readScanlines(ILuint *image, ILint width, ILint height, CHANNEL *channel, ILuint alpha);
ILuint readScanline(ILubyte *scan, ILint width, CHANNEL *channel, ILint bytes);
ILboolean channelReadRaw(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
ILboolean channelReadPure(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
ILboolean channelReadMixed(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
#endif//PIC_H

View File

@@ -0,0 +1,46 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_pnm.h
//
// Description: Reads/writes to/from pbm/pgm/ppm formats
//
//-----------------------------------------------------------------------------
#ifndef PPMPGM_H
#define PPMPGM_H
#include "il_internal.h"
#define IL_PBM_ASCII 0x0001
#define IL_PGM_ASCII 0x0002
#define IL_PPM_ASCII 0x0003
#define IL_PBM_BINARY 0x0004
#define IL_PGM_BINARY 0x0005
#define IL_PPM_BINARY 0x0006
typedef struct PPMINFO
{
ILenum Type;
ILuint Width;
ILuint Height;
ILuint MaxColour;
ILubyte Bpp;
} PPMINFO;
ILboolean iIsValidPnm(ILvoid);
ILboolean iCheckPnm(char Header[2]);
ILboolean iLoadPnmInternal(ILvoid);
ILboolean iSavePnmInternal(ILvoid);
ILimage *ilReadAsciiPpm(PPMINFO *Info);
ILimage *ilReadBinaryPpm(PPMINFO *Info);
ILimage *ilReadBitPbm(PPMINFO *Info);
ILboolean iGetWord(ILvoid);
ILvoid PbmMaximize(ILimage *Image);
#endif//PPMPGM_H

View File

@@ -0,0 +1,56 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2001 by Denton Woods
// Last modified: 01/23/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_il_psd.c
//
// Description: Reads from a PhotoShop (.psd) file.
//
//-----------------------------------------------------------------------------
#ifndef PSD_H
#define PSD_H
#include "il_internal.h"
#ifdef _MSC_VER
#pragma pack(push, packed_struct, 1)
#endif
typedef struct PSDHEAD
{
ILubyte Signature[4];
ILushort Version;
ILubyte Reserved[6];
ILushort Channels;
ILuint Height;
ILuint Width;
ILushort Depth;
ILushort Mode;
} IL_PACKSTRUCT PSDHEAD;
#ifdef _MSC_VER
#pragma pack(pop, packed_struct)
#endif
ILushort ChannelNum;
ILboolean iIsValidPsd(ILvoid);
ILboolean iCheckPsd(PSDHEAD *Header);
ILboolean iLoadPsdInternal(ILvoid);
ILboolean ReadPsd(PSDHEAD *Head);
ILboolean ReadGrey(PSDHEAD *Head);
ILboolean ReadIndexed(PSDHEAD *Head);
ILboolean ReadRGB(PSDHEAD *Head);
ILboolean ReadCMYK(PSDHEAD *Head);
ILuint *GetCompChanLen(PSDHEAD *Head);
ILboolean PsdGetData(PSDHEAD *Head, ILvoid *Buffer, ILboolean Compressed);
ILboolean ParseResources(ILuint ResourceSize, ILubyte *Resources);
ILboolean GetSingleChannel(PSDHEAD *Head, ILubyte *Buffer, ILboolean Compressed);
ILboolean iSavePsdInternal(ILvoid);
#endif//PSD_H

View File

@@ -0,0 +1,250 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/02/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_psp.h
//
// Description: Reads a Paint Shop Pro file.
//
//-----------------------------------------------------------------------------
#ifndef PSP_H
#define PSP_H
#include "il_internal.h"
// Block identifiers
enum PSPBlockID {
PSP_IMAGE_BLOCK = 0, // (0) General Image Attributes Block (main)
PSP_CREATOR_BLOCK, // (1) Creator Data Block (main)
PSP_COLOR_BLOCK, // (2) Color Palette Block (main and sub)
PSP_LAYER_START_BLOCK, // (3) Layer Bank Block (main)
PSP_LAYER_BLOCK, // (4) Layer Block (sub)
PSP_CHANNEL_BLOCK, // (5) Channel Block (sub)
PSP_SELECTION_BLOCK, // (6) Selection Block (main)
PSP_ALPHA_BANK_BLOCK, // (7) Alpha Bank Block (main)
PSP_ALPHA_CHANNEL_BLOCK, // (8) Alpha Channel Block (sub)
PSP_COMPOSITE_IMAGE_BLOCK, // (9) Composite Image Block (sub)
PSP_EXTENDED_DATA_BLOCK, // (10) Extended Data Block (main)
PSP_TUBE_BLOCK, // (11) Picture Tube Data Block (main)
PSP_ADJUSTMENT_EXTENSION_BLOCK, // (12) Adjustment Layer Block (sub)
PSP_VECTOR_EXTENSION_BLOCK, // (13) Vector Layer Block (sub)
PSP_SHAPE_BLOCK, // (14) Vector Shape Block (sub)
PSP_PAINTSTYLE_BLOCK, // (15) Paint Style Block (sub)
PSP_COMPOSITE_IMAGE_BANK_BLOCK, // (16) Composite Image Bank (main)
PSP_COMPOSITE_ATTRIBUTES_BLOCK, // (17) Composite Image Attr. (sub)
PSP_JPEG_BLOCK, // (18) JPEG Image Block (sub)
PSP_LINESTYLE_BLOCK, // (19) Line Style Block (sub)
PSP_TABLE_BANK_BLOCK, // (20) Table Bank Block (main)
PSP_TABLE_BLOCK, // (21) Table Block (sub)
PSP_PAPER_BLOCK, // (22) Vector Table Paper Block (sub)
PSP_PATTERN_BLOCK, // (23) Vector Table Pattern Block (sub)
};
// Bitmap type
enum PSPDIBType {
PSP_DIB_IMAGE = 0, // Layer color bitmap
PSP_DIB_TRANS_MASK, // Layer transparency mask bitmap
PSP_DIB_USER_MASK, // Layer user mask bitmap
PSP_DIB_SELECTION, // Selection mask bitmap
PSP_DIB_ALPHA_MASK, // Alpha channel mask bitmap
PSP_DIB_THUMBNAIL // Thumbnail bitmap
};
// Channel types
enum PSPChannelType {
PSP_CHANNEL_COMPOSITE = 0, // Channel of single channel bitmap
PSP_CHANNEL_RED, // Red channel of 24 bit bitmap
PSP_CHANNEL_GREEN, // Green channel of 24 bit bitmap
PSP_CHANNEL_BLUE // Blue channel of 24 bit bitmap
};
// Possible metrics used to measure resolution
enum PSP_METRIC {
PSP_METRIC_UNDEFINED = 0, // Metric unknown
PSP_METRIC_INCH, // Resolution is in inches
PSP_METRIC_CM // Resolution is in centimeters
};
// Possible types of compression.
enum PSPCompression {
PSP_COMP_NONE = 0, // No compression
PSP_COMP_RLE, // RLE compression
PSP_COMP_LZ77, // LZ77 compression
PSP_COMP_JPEG // JPEG compression (only used by thumbnail and composite image)
};
// Picture tube placement mode.
enum TubePlacementMode {
tpmRandom, // Place tube images in random intervals
tpmConstant // Place tube images in constant intervals
};
// Picture tube selection mode.
enum TubeSelectionMode {
tsmRandom, // Randomly select the next image in tube to display
tsmIncremental, // Select each tube image in turn
tsmAngular, // Select image based on cursor direction
tsmPressure, // Select image based on pressure (from pressure-sensitive pad)
tsmVelocity // Select image based on cursor speed
};
// Extended data field types.
enum PSPExtendedDataID {
PSP_XDATA_TRNS_INDEX = 0 // Transparency index field
};
// Creator field types.
enum PSPCreatorFieldID {
PSP_CRTR_FLD_TITLE = 0, // Image document title field
PSP_CRTR_FLD_CRT_DATE, // Creation date field
PSP_CRTR_FLD_MOD_DATE, // Modification date field
PSP_CRTR_FLD_ARTIST, // Artist name field
PSP_CRTR_FLD_CPYRGHT, // Copyright holder name field
PSP_CRTR_FLD_DESC, // Image document description field
PSP_CRTR_FLD_APP_ID, // Creating app id field
PSP_CRTR_FLD_APP_VER, // Creating app version field
};
// Creator application identifiers.
enum PSPCreatorAppID {
PSP_CREATOR_APP_UNKNOWN = 0, // Creator application unknown
PSP_CREATOR_APP_PAINT_SHOP_PRO // Creator is Paint Shop Pro
};
// Layer types.
enum PSPLayerType {
PSP_LAYER_NORMAL = 0, // Normal layer
PSP_LAYER_FLOATING_SELECTION // Floating selection layer
};
// Truth values.
/*enum PSP_BOOLEAN {
FALSE = 0,
TRUE
};*/
#ifdef _MSC_VER
#pragma pack(push, packed_struct, 1)
#endif
typedef struct PSPRECT
{
ILuint x1,y1,x2,y2;
} IL_PACKSTRUCT PSPRECT;
typedef struct PSPHEAD
{
char FileSig[32];
ILushort MajorVersion;
ILushort MinorVersion;
} IL_PACKSTRUCT PSPHEAD;
typedef struct BLOCKHEAD
{
ILubyte HeadID[4];
ILushort BlockID;
ILuint BlockLen;
} IL_PACKSTRUCT BLOCKHEAD;
typedef struct GENATT_CHUNK
{
ILint Width;
ILint Height;
ILdouble Resolution;
ILubyte ResMetric;
ILushort Compression;
ILushort BitDepth;
ILushort PlaneCount;
ILuint ColourCount;
ILubyte GreyscaleFlag;
ILuint SizeOfImage;
ILint ActiveLayer;
ILushort LayerCount;
ILuint GraphicContents;
} IL_PACKSTRUCT GENATT_CHUNK;
typedef struct LAYERINFO_CHUNK
{
ILubyte LayerType;
PSPRECT ImageRect;
PSPRECT SavedImageRect;
ILubyte Opacity;
ILubyte BlendingMode;
ILubyte LayerFlags;
ILubyte TransProtFlag;
ILubyte LinkID;
PSPRECT MaskRect;
PSPRECT SavedMaskRect;
ILubyte MaskLinked;
ILubyte MaskDisabled;
ILubyte InvertMaskBlend;
ILushort BlendRange;
ILubyte SourceBlend1[4];
ILubyte DestBlend1[4];
ILubyte SourceBlend2[4];
ILubyte DestBlend2[4];
ILubyte SourceBlend3[4];
ILubyte DestBlend3[4];
ILubyte SourceBlend4[4];
ILubyte DestBlend4[4];
ILubyte SourceBlend5[4];
ILubyte DestBlend5[4];
} IL_PACKSTRUCT LAYERINFO_CHUNK;
typedef struct LAYERBITMAP_CHUNK
{
ILushort NumBitmaps;
ILushort NumChannels;
} IL_PACKSTRUCT LAYERBITMAP_CHUNK;
typedef struct CHANNEL_CHUNK
{
ILuint CompLen;
ILuint Length;
ILushort BitmapType;
ILushort ChanType;
} IL_PACKSTRUCT CHANNEL_CHUNK;
typedef struct ALPHAINFO_CHUNK
{
PSPRECT AlphaRect;
PSPRECT AlphaSavedRect;
} IL_PACKSTRUCT ALPHAINFO_CHUNK;
typedef struct ALPHA_CHUNK
{
ILushort BitmapCount;
ILushort ChannelCount;
} IL_PACKSTRUCT ALPHA_CHUNK;
#ifdef _MSC_VER
#pragma pack(pop, packed_struct)
#endif
// Function definitions
ILboolean iLoadPspInternal(ILvoid);
ILboolean iCheckPsp(ILvoid);
ILboolean iIsValidPsp(ILvoid);
ILboolean ReadGenAttributes(ILvoid);
ILboolean ParseChunks(ILvoid);
ILboolean ReadLayerBlock(ILuint BlockLen);
ILboolean ReadAlphaBlock(ILuint BlockLen);
ILubyte *GetChannel(ILvoid);
ILboolean UncompRLE(ILubyte *CompData, ILubyte *Data, ILuint CompLen);
ILboolean ReadPalette(ILuint BlockLen);
ILboolean AssembleImage(ILvoid);
ILboolean Cleanup(ILvoid);
#endif//PSP_H

View File

@@ -0,0 +1,276 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_q2pal.h
//
// Description: The default Quake2 palette
//
//-----------------------------------------------------------------------------
#ifndef Q2PAL_H
#define Q2PAL_H
#define IL_Q2PAL_SIZE 768
ILubyte ilDefaultQ2Pal[IL_Q2PAL_SIZE] = {
0, 0, 0,
15, 15, 15,
31, 31, 31,
47, 47, 47,
63, 63, 63,
75, 75, 75,
91, 91, 91,
107, 107, 107,
123, 123, 123,
139, 139, 139,
155, 155, 155,
171, 171, 171,
187, 187, 187,
203, 203, 203,
219, 219, 219,
235, 235, 235,
99, 75, 35,
91, 67, 31,
83, 63, 31,
79, 59, 27,
71, 55, 27,
63, 47, 23,
59, 43, 23,
51, 39, 19,
47, 35, 19,
43, 31, 19,
39, 27, 15,
35, 23, 15,
27, 19, 11,
23, 15, 11,
19, 15, 7,
15, 11, 7,
95, 95, 111,
91, 91, 103,
91, 83, 95,
87, 79, 91,
83, 75, 83,
79, 71, 75,
71, 63, 67,
63, 59, 59,
59, 55, 55,
51, 47, 47,
47, 43, 43,
39, 39, 39,
35, 35, 35,
27, 27, 27,
23, 23, 23,
19, 19, 19,
143, 119, 83,
123, 99, 67,
115, 91, 59,
103, 79, 47,
207, 151, 75,
167, 123, 59,
139, 103, 47,
111, 83, 39,
235, 159, 39,
203, 139, 35,
175, 119, 31,
147, 99, 27,
119, 79, 23,
91, 59, 15,
63, 39, 11,
35, 23, 7,
167, 59, 43,
159, 47, 35,
151, 43, 27,
139, 39, 19,
127, 31, 15,
115, 23, 11,
103, 23, 7,
87, 19, 0,
75, 15, 0,
67, 15, 0,
59, 15, 0,
51, 11, 0,
43, 11, 0,
35, 11, 0,
27, 7, 0,
19, 7, 0,
123, 95, 75,
115, 87, 67,
107, 83, 63,
103, 79, 59,
95, 71, 55,
87, 67, 51,
83, 63, 47,
75, 55, 43,
67, 51, 39,
63, 47, 35,
55, 39, 27,
47, 35, 23,
39, 27, 19,
31, 23, 15,
23, 15, 11,
15, 11, 7,
111, 59, 23,
95, 55, 23,
83, 47, 23,
67, 43, 23,
55, 35, 19,
39, 27, 15,
27, 19, 11,
15, 11, 7,
179, 91, 79,
191, 123, 111,
203, 155, 147,
215, 187, 183,
203, 215, 223,
179, 199, 211,
159, 183, 195,
135, 167, 183,
115, 151, 167,
91, 135, 155,
71, 119, 139,
47, 103, 127,
23, 83, 111,
19, 75, 103,
15, 67, 91,
11, 63, 83,
7, 55, 75,
7, 47, 63,
7, 39, 51,
0, 31, 43,
0, 23, 31,
0, 15, 19,
0, 7, 11,
0, 0, 0,
139, 87, 87,
131, 79, 79,
123, 71, 71,
115, 67, 67,
107, 59, 59,
99, 51, 51,
91, 47, 47,
87, 43, 43,
75, 35, 35,
63, 31, 31,
51, 27, 27,
43, 19, 19,
31, 15, 15,
19, 11, 11,
11, 7, 7,
0, 0, 0,
151, 159, 123,
143, 151, 115,
135, 139, 107,
127, 131, 99,
119, 123, 95,
115, 115, 87,
107, 107, 79,
99, 99, 71,
91, 91, 67,
79, 79, 59,
67, 67, 51,
55, 55, 43,
47, 47, 35,
35, 35, 27,
23, 23, 19,
15, 15, 11,
159, 75, 63,
147, 67, 55,
139, 59, 47,
127, 55, 39,
119, 47, 35,
107, 43, 27,
99, 35, 23,
87, 31, 19,
79, 27, 15,
67, 23, 11,
55, 19, 11,
43, 15, 7,
31, 11, 7,
23, 7, 0,
11, 0, 0,
0, 0, 0,
119, 123, 207,
111, 115, 195,
103, 107, 183,
99, 99, 167,
91, 91, 155,
83, 87, 143,
75, 79, 127,
71, 71, 115,
63, 63, 103,
55, 55, 87,
47, 47, 75,
39, 39, 63,
35, 31, 47,
27, 23, 35,
19, 15, 23,
11, 7, 7,
155, 171, 123,
143, 159, 111,
135, 151, 99,
123, 139, 87,
115, 131, 75,
103, 119, 67,
95, 111, 59,
87, 103, 51,
75, 91, 39,
63, 79, 27,
55, 67, 19,
47, 59, 11,
35, 47, 7,
27, 35, 0,
19, 23, 0,
11, 15, 0,
0, 255, 0,
35, 231, 15,
63, 211, 27,
83, 187, 39,
95, 167, 47,
95, 143, 51,
95, 123, 51,
255, 255, 255,
255, 255, 211,
255, 255, 167,
255, 255, 127,
255, 255, 83,
255, 255, 39,
255, 235, 31,
255, 215, 23,
255, 191, 15,
255, 171, 7,
255, 147, 0,
239, 127, 0,
227, 107, 0,
211, 87, 0,
199, 71, 0,
183, 59, 0,
171, 43, 0,
155, 31, 0,
143, 23, 0,
127, 15, 0,
115, 7, 0,
95, 0, 0,
71, 0, 0,
47, 0, 0,
27, 0, 0,
239, 0, 0,
55, 55, 255,
255, 0, 0,
0, 0, 255,
43, 43, 35,
27, 27, 23,
19, 19, 15,
235, 151, 127,
195, 115, 83,
159, 87, 51,
123, 63, 27,
235, 211, 199,
199, 171, 155,
167, 139, 119,
135, 107, 87,
159, 91, 83
};
#endif//Q2PAL_H

View File

@@ -0,0 +1,41 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_register.h
//
// Description: Allows the caller to specify user-defined callback functions
// to open files DevIL does not support, to parse files
// differently, or anything else a person can think up.
//
//-----------------------------------------------------------------------------
#ifndef REGISTER_H
#define REGISTER_H
#include "il_internal.h"
typedef struct iFormatL
{
ILstring Ext;
IL_LOADPROC Load;
struct iFormatL *Next;
} iFormatL;
typedef struct iFormatS
{
ILstring Ext;
IL_SAVEPROC Save;
struct iFormatS *Next;
} iFormatS;
#define I_LOAD_FUNC 0
#define I_SAVE_FUNC 1
ILboolean iRegisterLoad(ILconst_string FileName);
ILboolean iRegisterSave(ILconst_string FileName);
#endif//REGISTER_H

View File

@@ -0,0 +1,92 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_rle.h
//
// Description: Functions for run-length encoding
//
//-----------------------------------------------------------------------------
#ifndef RLE_H
#define RLE_H
#include "il_internal.h"
#define TGA_MAX_RUN 128
#define SGI_MAX_RUN 127
#define BMP_MAX_RUN 127
#ifdef IL_RLE_C
#undef NOINLINE
#undef INLINE
#define INLINE
#endif
#ifndef NOINLINE
INLINE ILuint GetPix(ILubyte *p, ILuint bpp) {
ILuint Pixel;
Pixel = (ILuint)*p++;
while( bpp-- > 1 ) {
Pixel <<= 8;
Pixel |= (ILuint)*p++;
}
return Pixel;
}
INLINE ILint CountDiffPixels(ILubyte *p, ILuint bpp, ILuint pixCnt) {
ILuint pixel;
ILuint nextPixel = 0;
ILint n;
n = 0;
if (pixCnt == 1)
return pixCnt;
pixel = GetPix(p, bpp);
while (pixCnt > 1) {
p += bpp;
nextPixel = GetPix(p, bpp);
if (nextPixel == pixel)
break;
pixel = nextPixel;
++n;
--pixCnt;
}
if (nextPixel == pixel)
return n;
return n + 1;
}
INLINE ILint CountSamePixels(ILubyte *p, ILuint bpp, ILuint pixCnt) {
ILuint pixel;
ILuint nextPixel;
ILint n;
n = 1;
pixel = GetPix(p, bpp);
pixCnt--;
while (pixCnt > 0) {
p += bpp;
nextPixel = GetPix(p, bpp);
if (nextPixel != pixel)
break;
++n;
--pixCnt;
}
return n;
}
#endif
ILuint GetPix(ILubyte *p, ILuint bpp);
ILint CountDiffPixels(ILubyte *p, ILuint bpp, ILuint pixCnt);
ILint CountSamePixels(ILubyte *p, ILuint bpp, ILuint pixCnt);
#endif//RLE_H

View File

@@ -0,0 +1,66 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/sgi.h
//
// Description: Reads from and writes to SGI graphics files.
//
//-----------------------------------------------------------------------------
#ifndef SGI_H
#define SGI_H
#include "il_internal.h"
typedef struct iSgiHeader
{
ILshort MagicNum; // IRIS image file magic number
ILbyte Storage; // Storage format
ILbyte Bpc; // Number of bytes per pixel channel
ILushort Dim; // Number of dimensions
// 1: single channel, 1 row with XSize pixels
// 2: single channel, XSize*YSize pixels
// 3: ZSize channels, XSize*YSize pixels
ILushort XSize; // X size in pixels
ILushort YSize; // Y size in pixels
ILushort ZSize; // Number of channels
ILint PixMin; // Minimum pixel value
ILint PixMax; // Maximum pixel value
ILint Dummy1; // Ignored
ILbyte Name[80]; // Image name
ILint ColMap; // Colormap ID
ILbyte Dummy[404]; // Ignored
} IL_PACKSTRUCT iSgiHeader;
// Sgi format #define's
#define SGI_VERBATIM 0
#define SGI_RLE 1
#define SGI_MAGICNUM 474
// Sgi colormap types
#define SGI_COLMAP_NORMAL 0
#define SGI_COLMAP_DITHERED 1
#define SGI_COLMAP_SCREEN 2
#define SGI_COLMAP_COLMAP 3
// Internal functions
ILboolean iIsValidSgi(ILvoid);
ILboolean iCheckSgi(iSgiHeader *Header);
ILboolean iLoadSgiInternal(ILvoid);
ILboolean iSaveSgiInternal(ILvoid);
ILvoid iExpandScanLine(ILubyte *Dest, ILubyte *Src, ILuint Bpc);
ILint iGetScanLine(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length);
ILint iGetScanLineFast(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length, ILubyte*);
ILvoid sgiSwitchData(ILubyte *Data, ILuint SizeOfData);
ILboolean iNewSgi(iSgiHeader *Head);
ILboolean iReadNonRleSgi(iSgiHeader *Head);
ILboolean iReadRleSgi(iSgiHeader *Head);
ILboolean iSaveRleSgi(ILubyte *Data, ILuint w, ILuint h, ILuint numChannels, ILuint bps);
#endif//SGI_H

View File

@@ -0,0 +1,43 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_stack.h
//
// Description: The main image stack
//
//-----------------------------------------------------------------------------
#ifndef IMAGESTACK_H
#define IMAGESTACK_H
#include "il_internal.h"
// Just a guess...seems large enough
#define I_STACK_INCREMENT 1024
typedef struct iFree
{
ILuint Name;
void *Next;
} iFree;
// Internal functions
ILboolean iEnlargeStack(ILvoid);
ILvoid iFreeMem(ILvoid);
// Globals for il_stack.c
ILuint StackSize = 0;
ILuint LastUsed = 0;
ILuint CurName = 0;
ILimage **ImageStack = NULL;
iFree *FreeNames = NULL;
ILboolean OnExit = IL_FALSE;
ILboolean ParentImage = IL_TRUE;
#endif//IMAGESTACK_H

View File

@@ -0,0 +1,266 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/24/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/src/il_states.h
//
// Description: State machine
//
//-----------------------------------------------------------------------------
#ifndef STATES_H
#define STATES_H
#include "il_internal.h"
ILboolean ilAble(ILenum Mode, ILboolean Flag);
#define IL_ATTRIB_STACK_MAX 32
ILuint ilCurrentPos = 0; // Which position on the stack
//
// Various states
//
typedef struct IL_STATES
{
// Origin states
ILboolean ilOriginSet;
ILenum ilOriginMode;
// Format and type states
ILboolean ilFormatSet;
ILboolean ilTypeSet;
ILenum ilFormatMode;
ILenum ilTypeMode;
// File mode states
ILboolean ilOverWriteFiles;
// Palette states
ILboolean ilAutoConvPal;
// Load fail states
ILboolean ilDefaultOnFail;
// Key colour states
ILboolean ilUseKeyColour;
// Compression states
ILenum ilCompression;
// Interlace states
ILenum ilInterlace;
// Quantization states
ILenum ilQuantMode;
ILuint ilNeuSample;
ILuint ilQuantMaxIndexs;
// DXTC states
ILboolean ilKeepDxtcData;
//
// Format-specific states
//
ILboolean ilTgaCreateStamp;
ILuint ilJpgQuality;
ILboolean ilPngInterlace;
ILboolean ilTgaRle;
ILboolean ilBmpRle;
ILboolean ilSgiRle;
ILenum ilJpgFormat;
ILenum ilDxtcFormat;
ILenum ilPcdPicNum;
ILint ilPngAlphaIndex; // this index should be treated as an alpha key (most formats use this rather than having alpha in the palette), -1 for none
// currently only used when writing out .png files and should obviously be set to -1 most of the time
//
// Format-specific strings
//
char *ilTgaId;
char *ilTgaAuthName;
char *ilTgaAuthComment;
char *ilPngAuthName;
char *ilPngTitle;
char *ilPngDescription;
char *ilTifDescription;
char *ilTifHostComputer;
char *ilTifDocumentName;
char *ilTifAuthName;
char *ilCHeader;
} IL_STATES;
IL_STATES ilStates[IL_ATTRIB_STACK_MAX];
typedef struct IL_HINTS
{
// Memory vs. Speed trade-off
ILenum MemVsSpeedHint;
// Compression hints
ILenum CompressHint;
} IL_HINTS;
IL_HINTS ilHints;
#ifndef IL_NO_BMP
#define IL_BMP_EXT "bmp dib "
#else
#define IL_BMP_EXT ""
#endif
#ifndef IL_NO_CHEAD
#define IL_CHEAD_EXT "h "
#else
#define IL_CHEAD_EXT ""
#endif
#ifndef IL_NO_CUT
#define IL_CUT_EXT "cut "
#else
#define IL_CUT_EXT ""
#endif
#ifndef IL_NO_DCX
#define IL_DCX_EXT "dcx "
#else
#define IL_DCX_EXT ""
#endif
#ifndef IL_NO_DDS
#define IL_DDS_EXT "dds "
#else
#define IL_DDS_EXT ""
#endif
#ifndef IL_NO_GIF
#define IL_GIF_EXT "gif "
#else
#define IL_GIF_EXT ""
#endif
#ifndef IL_NO_HDR
#define IL_HDR_EXT "hdr "
#else
#define IL_HDR_EXT ""
#endif
#ifndef IL_NO_ICO
#define IL_ICO_EXT "ico cur "
#else
#define IL_ICO_EXT ""
#endif
#ifndef IL_NO_JPG
#define IL_JPG_EXT "jpg jpe jpeg "
#else
#define IL_JPG_EXT ""
#endif
#ifndef IL_NO_LIF
#define IL_LIF_EXT "lif "
#else
#define IL_LIF_EXT ""
#endif
#ifndef IL_NO_MDL
#define IL_MDL_EXT "mdl "
#else
#define IL_MDL_EXT ""
#endif
#ifndef IL_NO_MNG
#define IL_MNG_EXT "mng jng "
#else
#define IL_MNG_EXT ""
#endif
#ifndef IL_NO_PCX
#define IL_PCX_EXT "pcx "
#else
#define IL_PCX_EXT ""
#endif
#ifndef IL_NO_PIC
#define IL_PIC_EXT "pic "
#else
#define IL_PIC_EXT ""
#endif
#ifndef IL_NO_PIX
#define IL_PIX_EXT "pix "
#else
#define IL_PIX_EXT ""
#endif
#ifndef IL_NO_PNG
#define IL_PNG_EXT "png "
#else
#define IL_PNG_EXT ""
#endif
#ifndef IL_NO_PNM
#define IL_PNM_EXT "pbm pgm pnm ppm "
#else
#define IL_PNM_EXT ""
#endif
#ifndef IL_NO_PSD
#define IL_PSD_EXT "psd pdd "
#else
#define IL_PSD_EXT ""
#endif
#ifndef IL_NO_PSP
#define IL_PSP_EXT "psp "
#else
#define IL_PSP_EXT ""
#endif
#ifndef IL_NO_PXR
#define IL_PXR_EXT "pxr "
#else
#define IL_PXR_EXT ""
#endif
#ifndef IL_NO_SGI
#define IL_SGI_EXT "sgi bw rgb rgba "
#else
#define IL_SGI_EXT ""
#endif
#ifndef IL_NO_TGA
#define IL_TGA_EXT "tga vda icb vst "
#else
#define IL_TGA_EXT ""
#endif
#ifndef IL_NO_TIF
#define IL_TIF_EXT "tif tiff "
#else
#define IL_TIF_EXT ""
#endif
#ifndef IL_NO_WAL
#define IL_WAL_EXT "wal "
#else
#define IL_WAL_EXT ""
#endif
#ifndef IL_NO_XPM
#define IL_XPM_EXT "xpm "
#else

View File

@@ -0,0 +1,109 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_targa.h
//
// Description: Targa (.tga) functions
//
//-----------------------------------------------------------------------------
#ifndef TARGA_H
#define TARGA_H
#include "il_internal.h"
#ifdef _MSC_VER
#pragma pack(push, tga_struct, 1)
#elif defined(MACOSX) || defined(__GNUC__)
#pragma pack(1)
#endif
typedef struct TARGAHEAD
{
ILubyte IDLen;
ILubyte ColMapPresent;
ILubyte ImageType;
ILshort FirstEntry;
ILshort ColMapLen;
ILubyte ColMapEntSize;
ILshort OriginX;
ILshort OriginY;
ILushort Width;
ILushort Height;
ILubyte Bpp;
ILubyte ImageDesc;
} IL_PACKSTRUCT TARGAHEAD;
typedef struct TARGAFOOTER
{
ILuint ExtOff; // Extension Area Offset
ILuint DevDirOff; // Developer Directory Offset
ILbyte Signature[16]; // TRUEVISION-XFILE
ILbyte Reserved; // ASCII period '.'
ILbyte NullChar; // NULL
} IL_PACKSTRUCT TARGAFOOTER;
#if defined(MACOSX) || defined(__GNUC__)
#pragma pack()
#elif _MSC_VER
#pragma pack(pop, tga_struct)
#endif
#define TGA_EXT_LEN 495
typedef struct TARGAEXT
{
// Dev Directory
// We don't mess with this
// Extension Area
ILshort Size; // should be TGA_EXT_LEN
ILbyte AuthName[41]; // the image author's name
ILbyte AuthComments[324]; // author's comments
ILshort Month, Day, Year, Hour, Minute, Second; // internal date of file
ILbyte JobID[41]; // the job description (if any)
ILshort JobHour, JobMin, JobSecs; // the job's time
ILbyte SoftwareID[41]; // the software that created this
ILshort SoftwareVer; // the software version number * 100
ILbyte SoftwareVerByte; // the software version letter
ILint KeyColor; // the transparent colour
} TARGAEXT;
// Different Targa formats
#define TGA_NO_DATA 0
#define TGA_COLMAP_UNCOMP 1
#define TGA_UNMAP_UNCOMP 2
#define TGA_BW_UNCOMP 3
#define TGA_COLMAP_COMP 9
#define TGA_UNMAP_COMP 10
#define TGA_BW_COMP 11
// Targa origins
#define IMAGEDESC_ORIGIN_MASK 0x30
#define IMAGEDESC_TOPLEFT 0x20
#define IMAGEDESC_BOTLEFT 0x00
#define IMAGEDESC_BOTRIGHT 0x10
#define IMAGEDESC_TOPRIGHT 0x30
// Internal functions
ILboolean iIsValidTarga();
ILboolean iGetTgaHead(TARGAHEAD *Header);
ILboolean iCheckTarga(TARGAHEAD *Header);
ILboolean iLoadTargaInternal(ILvoid);
ILboolean iSaveTargaInternal(ILvoid);
//ILvoid iMakeString(char *Str);
ILboolean iReadBwTga(TARGAHEAD *Header);
ILboolean iReadColMapTga(TARGAHEAD *Header);
ILboolean iReadUnmapTga(TARGAHEAD *Header);
ILboolean iUncompressTgaData(ILimage *Image);
ILboolean i16BitTarga(ILimage *Image);
ILvoid iGetDateTime(ILuint *Month, ILuint *Day, ILuint *Yr, ILuint *Hr, ILuint *Min, ILuint *Sec);
#endif//TARGA_H

Some files were not shown because too many files have changed in this diff Show More