Compiling FlaME under mono

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Compiling FlaME under mono

Post by NoQ »

Flail13 wrote:I managed to get flaME to run in MonoDevelop, without noticing any serious problems. Perhaps the way I did it is not ideal, but it seems to work.
The code is here. Is this helpful to anyone?
When i try to compile the source, the following errors appear:

Code: Select all

~/flaME - MonoDevelop/flaME/clsMap.vb (2398,174) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (176,147) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (191,147) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (238,144) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (285,144) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (332,144) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (347,141) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (362,141) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (377,141) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/clsTileset.vb (388,141) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/My Project/Application.Designer.vb (35,40) : Error VBNC30691: 'flaME.frmMain' is a type and cannot be used as an expression.
~/flaME - MonoDevelop/flaME/ctrlMapView.vb (2309,54) : Error VBNC30408: Method 'Sub ListSelect_Close()' does not have the same signature as delegate 'Delegate Sub ToolStripDropDownClosedEventHandler(sender As System.Object, e As System.Windows.Forms.ToolStripDropDownClosedEventArgs)'.
~/flaME - MonoDevelop/flaME/ctrlMapView.vb (3144,38) : Error VBNC99999: <no message written yet>
~/flaME - MonoDevelop/flaME/ctrlMapView.vb (3310,60) : Error VBNC30408: Method 'Sub RemoveUndoMessage()' does not have the same signature as delegate 'System.EventHandler'.
~/flaME - MonoDevelop/flaME/frmMain.vb (4702,138) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/frmMain.vb (4719,138) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
~/flaME - MonoDevelop/flaME/frmMain.vb (4749,191) : Error VBNC30311: Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr'.
When i try to run the pre-built executable included in the archive, it crashes with the following error:

Code: Select all

Unhandled Exception: System.InvalidOperationException: WinForms_SeeInnerException ---> System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in <filename unknown>:0 
  at System.Drawing.Bitmap..ctor (System.String filename, Boolean useIcm) [0x00000] in <filename unknown>:0 
  at System.Drawing.Bitmap..ctor (System.String filename) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (string)
  at flaME.frmMain..ctor () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at flaME.My.MyProject+MyForms.Create__Instance__[frmMain] (flaME.frmMain Instance) [0x00000] in <filename unknown>:0 
  at flaME.My.MyProject+MyForms.get_frmMain () [0x00000] in <filename unknown>:0 
  at flaME.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0 
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0 
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0 
  at flaME.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0 
mono 2.10.1, mono-develop 2.4.2:

Code: Select all

Mono JIT compiler version 2.10.1 (tarball Mon Mar  7 12:29:23 UTC 2011)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

Is that on an OS other than Windows? I'm only on Windows 7.

Do you know what else needs to be changed to make it work on another OS? I remember macuser had to change "\" to "/" for filenames, for use on a Mac. Apart from that I have no idea what is needed.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Flail13 wrote:Is that on an OS other than Windows? I'm only on Windows 7.

Do you know what else needs to be changed to make it work on another OS? I remember macuser had to change "\" to "/" for filenames, for use on a Mac. Apart from that I have no idea what is needed.
Archlinux here; that's the only purpose for compiling FlaME for me so far (:
Anyway, i know close to nothing about .NET, and i guess we're not running into filename separator issues yet; any ideas what can these errors mean? These System.Byte-bla-bla-bla seem to be easy (?)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Hmm, i seem to be missing System.Deployment reference. Any idea how to get [rid of] it?
upd: first google link ... just keep thinking ...
upd: fail; sounds as if this reference is meaningless and can be safely deleted, but the problems remain the same.
upd: maybe the cast should be made somehow more explicit in the source?
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

I know some of those errors in the first block, but not why you have them and I don't.

Cannot convert from 'System.Byte[0...,0...,0...]' to 'System.IntPtr' -- It doesn't like the 3D array of pixel bytes being passed to OpenTK in that way. I might need to use some type of pointer. Im looking it up.

The "X does not have the same signature as delegate Y" errors are true but VB doesn't require it. the parameters of those methods can be easily changed.

~/flaME - MonoDevelop/flaME/My Project/Application.Designer.vb (35,40) : Error VBNC30691: 'flaME.frmMain' is a type and cannot be used as an expression.
~/flaME - MonoDevelop/flaME/ctrlMapView.vb (3144,38) : Error VBNC99999: <no message written yet>
-- perhaps it doesn't like frmMain as both a type and an instance of a form.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

By the way, which of the arguments is "System.Byte[0...,0...,0...]"? :oops:
I'll build it even if i'd have to ... learn visual basic for that (!!!)
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

It's the last one that is usually called something like "Texture". For example:
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, 64, 64, 0, PixelFormat.Rgba, PixelType.UnsignedByte, Texture)

edit: For future communication we could go to PM. There's not really any need to put this on the forums.
Last edited by Flail13 on 03 Apr 2011, 10:10, edited 2 times in total.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Changing it to something like

Code: Select all

CType(Texture,System.IntPtr)
seems to fix the error message; looking more into it.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Flail13 wrote:edit: For future communication we could go to PM. There's not really any need to put this on the forums.
I think there is. Maybe someone else would help us (?)
edit: IRC is a good choice too.
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

I think there is. Maybe someone else would help us (?)
True

Code: Select all

CType(Texture,System.IntPtr)
isn't even a valid statment in MonoDevelop or VB over here. I get a can't convert error with it in both.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

What about DirectCast?

Anyway, understanding other errors is more urgent (:
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

it has the same result, cannot convert
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Anyway, 4 errors remaining for me:

Code: Select all

~/flaME - MonoDevelop/flaME/My Project/Application.Designer.vb (35,40) : Error VBNC30691: 'flaME.frmMain' is a type and cannot be used as an expression.

~/flaME - MonoDevelop/flaME/ctrlMapView.vb (2310,54) : Error VBNC30408: Method 'Sub ListSelect_Close()' does not have the same signature as delegate 'Delegate Sub ToolStripDropDownClosedEventHandler(sender As System.Object, e As System.Windows.Forms.ToolStripDropDownClosedEventArgs)'.

~/flaME - MonoDevelop/flaME/ctrlMapView.vb (3145,38) : Error VBNC99999: <no message written yet>

~/flaME - MonoDevelop/flaME/ctrlMapView.vb (3311,60) : Error VBNC30408: Method 'Sub RemoveUndoMessage()' does not have the same signature as delegate 'System.EventHandler'.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Compiling FlaME under mono

Post by NoQ »

Application.Designer.vb: "Me.MainForm = New Global.flaME.frmMain" fixes the first error.
Last edited by NoQ on 03 Apr 2011, 10:47, edited 1 time in total.
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Compiling FlaME under mono

Post by Flail13 »

to fix the two signature errors:

in ctrlMapView:

go to line 2310
change

Code: Select all

Private Sub ListSelect_Close() Handles ListSelect.Closed
to

Code: Select all

Private Sub ListSelect_Close(sender As System.Object, e As System.Windows.Forms.ToolStripDropDownClosedEventArgs) Handles ListSelect.Closed
go to line 3311
change

Code: Select all

Public Sub RemoveUndoMessage() Handles UndoMessageTimer.Tick
to

Code: Select all

Public Sub RemoveUndoMessage(sender as Object, e as EventArgs) Handles UndoMessageTimer.Tick