Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: m!m on March 19, 2014, 01:02:17 pm

Title: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 19, 2014, 01:02:17 pm
As some of you might know I've been working on integrating the chromium browser engine (or a framework  (https://code.google.com/p/chromiumembedded/)specifically for embedding it) into FSO in an effort to be able to replace the current interface code.
It's far from being complete but I think that it is in a state which can be released for public testing, but first some screenshots:
(http://i.imgur.com/DI9Rd7l.png)
Browsing HLP while shooting Cylons

(http://i.imgur.com/3gLDtfU.png)
Yes, WebGL works

Here are the links to the test builds, as the required libraries and files are quite big I have uploaded them separately so I don't need to update them with the builds.
Installing:
Test Builds: Download (http://www.mediafire.com/download/wi02921sgzfd9t3/Chromium-2-7-14.7z) (dontcrashdontcrashdontcrashdontcrashdontcrash)
Required additional files: Download (http://www.mediafire.com/download/y66bn0xxuy60xok/chromiumLibs.7z)

You need both packages but once you have downloaded and unpacked the second package you will not need to download it again, even if the builds are updates. Place all files into the root of FSO while keeping the directory structure.

For those interested: Source code (https://github.com/asarium/fs2open.github.com/tree/feature/chromiumInput)

Building:
Special thanks to ngld for getting these changes to build on linux and also for improving the building process on Windows.


Using the builds:
As chromium uses some resources even if it isn't being used I decided to have it disabled by default so mod that don't use it don't use more resources than necessary. For this I added an option to the game_settings.tbl (http://www.hard-light.net/wiki/index.php/Game_settings.tbl).
After $FS2NetD port: you have the #CHROMIUM SETTINGS section which currently only has the $Enable Chromium: option which takes a boolean value to enable chromium. You will need this or else the browser won't work.
There are two ways of using the new capabilities:
Now let's see what you can do with all that, there is now a new table called states.tbl and the respective modular table *-sta.tbm. Here is an example of what you can do:
Code: (states.tbl) [Select]
#States

$State: GS_STATE_INITIAL_PLAYER_SELECT
+Type: HTML
+URL: http://fso/data/html/playerSelect.html

#End
$State takes a state name (documented on the wiki) and initializes custom logic for that state, currently there is only the type HTML. To configure which URL is used use the +URL option.

As you notice from the example above you can reference files of FSO by using the fso domain. The following path is the full path to the file you want to load relative to your mod directory.

Here is an example of what you can do with the player select screen: http://www.mediafire.com/download/8vcx13q70x1c9hd/browserTest.7z (http://www.mediafire.com/download/8vcx13q70x1c9hd/browserTest.7z)

You can also completely replace the default mainhall, here is an example: http://www.mediafire.com/download/xh2tm35aijm136c/mainhallTest.7z

To communicate with FSO from your JavaScript code there is the fsoApi object within the global scope which has three functions:

I know that this information is a bit sparse but it's a WIP project so all this is subject to change.

Please test the builds, especially without any changes to your mod as I want to make sure that it works the same with unaltered data.

Thank you very much,
Regards,
m!m
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Shivan Hunter on March 19, 2014, 05:25:49 pm
This is amazing (can't wait to see what Axem does with it!)

Also, EVE Online is no longer the only game I know of with an ingame web browser. suck it, goons :7
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: General Battuta on March 19, 2014, 06:37:48 pm
Post doges
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Mongoose on March 19, 2014, 07:43:16 pm
This is both amazing and frightening.

(stop fapping there co-pilot)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: T-Man on March 20, 2014, 05:44:07 pm
This does look bloody impressive I gotta say; have never even thought something like this was possible. My inner paranoid is worried about security issues (on the one hand AV/Firewalls on heavily protected PCs might throw hissy fits with FSO with lots of these running, on the other hand restricting the security to prevent that might leave big holes onto PCs; one troll with a hijacked file and cue chaos) but I know very little admittedly so they might turn out to be non-issues.

Regardless, this is truly amazing; no exaggeration. It will be fun to see what people create from this. :yes:

(stop fapping there co-pilot)
NO! Fie on you, what has been heard cannot be unheard! :shaking: :lol:
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Dragon on March 20, 2014, 06:13:11 pm
This is good and all, but does it have any practical applications? :)
Aside from posting testing feedback in real time (I suppose it'd be an improvement for me given that I'm now posting it in imaginary time :) ), I don't really see what an internet browser would be good for in FSO. It probably has some multiplayer implications, but I can't think off anything else.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Axem on March 20, 2014, 06:56:45 pm
The biggest would be a completely moddable interface. FreeSpace's out-of-mission interface is constrained to what retail was: made for 1024x768 resolutions, no way to change any of the buttons (unless you like mucking around with those mask files), and any custom interface would basically just be a skin.

But this would allow a custom interface (both out-of-mission and in-mission! (yes, hud gauges or in mission prompts)) to be made with HTML. It could scale intelligently to any resolution and aspect ratio. Add new interface screens, new buttons, new features. I mean so far its pretty much proof of concept, but there's a lot of potential.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: niffiwan on March 20, 2014, 07:26:05 pm
...My inner paranoid is worried about security issues...

I believe the intention is to disable access to the network in the final version, i.e. only be able to load data from the filesystem/disk. That should reduce the number of potential security issues.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Echelon9 on March 20, 2014, 11:58:10 pm
...My inner paranoid is worried about security issues...

I am of the view our network or table parsing code has more pressing security bugs than Chromium. Not that we shouldn't try to get those relentlessly out of the code base (cf work done with PVS-Studio, Clang/ASan, Coverity, Valgrind and MSVC Analyze), we should start with a realistic appreciation of the age of the code we inherited and that secure coding considerations weren't prevalent in late 1990s.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: niffiwan on March 21, 2014, 01:27:22 am
Indeed - I know there's a number of issues in the Coverity report related to accepting untrusted input from the disk or network.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: pecenipicek on March 21, 2014, 01:30:08 am
... with HTML. It could scale intelligently to any resolution and aspect ratio. ....
as someone who has to work with html on a daily basis.... yeahno.
neither on the scale part nor the "intelligently" :p
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 21, 2014, 03:56:04 am
As that is currently a bit lacking here is a quick list of what this can be used for:

The title of the thread may be a bit misleading but the intent is not to access the internet from FSO and some already have pointed out that every network access will be disabled by default. This also serves as a safeguard against using external resources which would make offline-play impossible.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: T-Man on March 21, 2014, 05:34:35 am
Ah so the base concept is using it as an interface creator? That makes a lot of sense (sorry I got the wrong end of the stick). Definitely a lot of scope with a GUI system like that and the different programs you could run through it, and for all my fears the online possibilities could have some cool uses in the future so it's excellent having it there as a possibility.

But nah, all this is sounding excellent. :yes:
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Shivan Hunter on March 22, 2014, 04:35:31 pm
... with HTML. It could scale intelligently to any resolution and aspect ratio. ....
as someone who has to work with html on a daily basis.... yeahno.
neither on the scale part nor the "intelligently" :p

~responsive web FS interface design~
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: pecenipicek on March 22, 2014, 07:07:20 pm
... with HTML. It could scale intelligently to any resolution and aspect ratio. ....
as someone who has to work with html on a daily basis.... yeahno.
neither on the scale part nor the "intelligently" :p

~responsive web FS interface design~
go die in a fire :p
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: The Dagger on March 23, 2014, 11:24:27 am
This looks very promisig indeed  :yes:.
However, I did found some strange behaviour. First, after the intro video FSO just stop for me. I thought it just crashed but if I Alt+Tab to get to Windows desktop and back to FSO I get a nice grass field in front of me (I guess it's a OpenGL example, really nice BTW). Also, I don't know if it's intended but I get duplicate chromiumprocess_3_7_1_SSE2.exe processes running according to Windows task manager.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 23, 2014, 11:28:26 am
:hopping: I though I fixed that!
Multiple chromium processes are intended, it's doing the same thing as Google chrome.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 26, 2014, 10:20:06 am
This looks very promisig indeed  :yes:.
However, I did found some strange behaviour. First, after the intro video FSO just stop for me. I thought it just crashed but if I Alt+Tab to get to Windows desktop and back to FSO I get a nice grass field in front of me (I guess it's a OpenGL example, really nice BTW). Also, I don't know if it's intended but I get duplicate chromiumprocess_3_7_1_SSE2.exe processes running according to Windows task manager.
I tried to reproduce your issue but I couldn't. I have encountered that problem and though I had fixed it. Just to be sure I uploaded new builds which are the same that I used for testing.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: The Dagger on March 26, 2014, 11:49:10 am
I've just redownloaded the exe and it's still the same. Is there anything I could do to help you find the cause of the issue?
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 27, 2014, 08:36:45 am
Just to confirm that it's the same bug I "fixed" earlier, can you try to run FSO in windowed mode?
If this can't be resolved, I will have to revert to another method which is slower and limits some functionality of the browser until we can fix this issue.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on March 28, 2014, 09:43:05 am
The link to the builds has been updated which should fix the black screen issue.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: The Dagger on March 28, 2014, 05:39:35 pm
The new build works great! I'm actually posting this from FSO!  :yes:
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: redsniper on March 31, 2014, 07:52:13 am
(http://i.somethingawful.com/forumsystem/emoticons/emot-psyboom.gif)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Luis Dias on March 31, 2014, 10:02:41 am
The new build works great! I'm actually posting this from FSO!  :yes:

dafuq is happening dAFUQ
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on April 04, 2014, 10:48:45 am
The links in the first post have been updated, you will need redownload both files as I updated the libraries.
The new builds now disallow access to anything but the FSO files, there is a new commandline option to allow that again.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Rodo on April 04, 2014, 11:49:56 am
The new build works great! I'm actually posting this from FSO!  :yes:

omg! fso web integration, now with Notifications!  ;)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on April 05, 2014, 07:08:51 am
Builds have been updated again to include some new features I needed for creating an initial mainhall demo: http://www.mediafire.com/download/xh2tm35aijm136c/mainhallTest.7z

I'm not very good at creating nice HTML pages but here is a preview:
(http://i.imgur.com/raCgRYi.png)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: The Dagger on April 05, 2014, 08:20:35 am
After redownloading everything, I get a crash on release and "Chromium subsystem is not inited" error right after the intro movie.
Why your builds no like me? :(
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on April 05, 2014, 09:04:55 am
I forgot to include the right mod table, try this: http://www.mediafire.com/download/xh2tm35aijm136c/mainhallTest.7z (link in the first post also updated)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: The Dagger on April 05, 2014, 09:54:05 am
Works OK now.  :)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on May 07, 2014, 05:05:21 am
Hmm... I'll just leave this here: http://www.hard-light.net/forums/index.php?topic=87498.msg1747309#msg1747309

Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on May 07, 2014, 05:29:20 am
The current version of chromium sadly does not support CSS transitions when rendering to an offscreen window (although there are plans to change that) so this can not be used in FSO (yet).
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on May 07, 2014, 06:40:29 am
FWIW, that's a CSS animation, not a transition. It uses CSS transforms.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on May 07, 2014, 07:07:17 am
Sorry, I meant to say CSS transforms.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on May 07, 2014, 07:15:25 am
Ah, ok. Does it support CSS border images? If so, that's 70% of the standard FS interface replicable right there. :)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on May 07, 2014, 07:22:14 am
I think it supports pretty much everything except CSS transforms because that requires some sort of hardware support which is not available with off-screen rendering.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on May 07, 2014, 07:24:16 am
I think it supports pretty much everything except CSS transforms because that requires some sort of hardware support which is not available with off-screen rendering.

Hmm, in that case, it might support 2D transforms... I think the hardware hookup is only for 3D transforms, using the graphic card. Still, the resulting 2D transform probably wouldn't look very smooth. ;)
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on May 07, 2014, 07:25:32 am
WebGL is supported so you might be able to do something with that (although it would be less straight forward than simple CSS transforms).
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on May 07, 2014, 07:34:05 am
Yeah, me and WebGL aren't friends yet. :p
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 02, 2014, 09:50:34 am
I have uploaded new builds that feature much improved rendering performance and now with ∞% more CSS3 3D transforms support! (I also tested the nice demo Sandwich posted which works perfectly now)
You will have to redownload the libraries package (the second link below the download link in the first post) as those have changed.

The builds are based on the Antipodes branch and may be a bit outdated.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on July 02, 2014, 11:08:09 am
Oooh.... :) Now I'm wanting to recreate the mainhall in CSS... :p
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 03, 2014, 06:32:22 am
I would appreciate if you would :p
The main reason I stated this was to replace the existing interface with a solution that can be changed by the modder. When this system is complete the modder will have complete control over how the interface looks like and it also opens more mission design possibilities considering what was already done with the very limited custom HUD gauges.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on July 04, 2014, 02:52:46 am
Hmm... How are the animations done in the existing mainhall - frame-by-frame animations overlaid on top of the BG?
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 04, 2014, 02:56:58 am
Yes, I think so but recently there were some changes which added some new features to the mainhall so it might have changed a bit.
The great this about HTML5 is that you can just use the <video> element to play an animation. No need for those ancient GIFs anymore ;7
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on July 04, 2014, 03:02:05 am
Indeed - and IIRC with the .webm video format, you can actually have alpha transparency in videos. However, I don't know if you can have enough control over the playback to make it go in reverse on mouseout.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 04, 2014, 03:04:06 am
Apparently playing a video in reverse is valid (http://stackoverflow.com/questions/5277293/is-it-possible-to-play-html5-video-in-reverse) but I don't know if Chrome implements that correctly.
EDIT: Damnit, just tested and it seems like Chrome does not support playing in reverse
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on July 04, 2014, 05:48:33 am
Hmm... any chance APNG animations can be controlled during playback?
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 04, 2014, 05:57:22 am
APNG is not natively supported currently but there is a Chrome extension that adds APNG playback so there is a way to load and display APNG files correctly.
After that is working correctly, playing an APNG file in reverse should be simple.

Another thing to consider is that you can render 3D models using WebGL which means that a 3D mainhall is not that unlikely anymore.

EDIT: After a quick google search I dound this project: https://github.com/davidmz/apng-canvas
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: mjn.mixael on July 04, 2014, 07:36:17 am
There is no way a real time 3d model can be as detailed.

EDIT: what I mean is that it sounds like chromium for mainhalls like what I've been doing will be a step in the wrong direction. But for BP style mainhalls, this will be awesome. :)

Yes, the mainhalls are animations played on top of the background.

Of course this will have applications far beyond just the main hall menu.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: ngld on July 04, 2014, 11:00:48 am
So... I tried to compile this on Linux and CMake fails in cmake/util.cmake:22 several times.

Seems like the parameters for ADD_IMPORTED_LIB() are wrong.

I've attached the CMakeOuput.log and CMakeError.log.
The console output is:
Code: [Select]
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected compatibility for the AVX feature set. Optimizations are done accordingly.
-- NO FS2PATH environment variable found, you can define this to point to your freespace install but it it not required.
CMake Warning at CMakeLists.txt:60 (message):
  CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.


-- cotire 1.5.2 loaded.
-- Doing configuration specific to gcc...
-- Performing Test COMPILER_SUPPORTS_CXX1Y
-- Performing Test COMPILER_SUPPORTS_CXX1Y - Success
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Configuring UNIX specific things and stuff...
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib64/libX11.so
-- Found OpenGL: /usr/lib64/libGL.so 
-- Performing Test HAS_CXX11_IS_TRIVIAL
-- Performing Test HAS_CXX11_IS_TRIVIAL - Success
-- Performing Test HAS_CXX11_IS_TRIVIALLY_COPYABLE
-- Performing Test HAS_CXX11_IS_TRIVIALLY_COPYABLE - Failed
-- Performing Test HAS_CXX11_STATIC_ASSERT
-- Performing Test HAS_CXX11_STATIC_ASSERT - Success
-- Performing Test HAS_CXX11_AUTO
-- Performing Test HAS_CXX11_AUTO - Success
-- Performing Test HAS_CXX11_OVERRIDE
-- Performing Test HAS_CXX11_OVERRIDE - Success
-- Performing Test HAS_CXX11_NOEXCEPT
-- Performing Test HAS_CXX11_NOEXCEPT - Success
CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/libjpeg/CMakeLists.txt:77 (ADD_IMPORTED_LIB)


CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/zlib/CMakeLists.txt:71 (ADD_IMPORTED_LIB)


-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for module 'ogg'
--   found ogg, version 1.3.1
-- checking for module 'theora'
--   found theora, version 1.1.1
-- checking for module 'vorbis'
--   found vorbis, version 1.3.4
-- checking for module 'vorbisfile'
--   found vorbisfile, version 1.3.4
CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/oggvorbis/CMakeLists.txt:15 (ADD_IMPORTED_LIB)


CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/oggvorbis/CMakeLists.txt:21 (ADD_IMPORTED_LIB)


CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/oggvorbis/CMakeLists.txt:24 (ADD_IMPORTED_LIB)


-- Found OpenAL: /usr/lib64/libopenal.so 
CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/openal/CMakeLists.txt:93 (ADD_IMPORTED_LIB)


-- checking for one of the modules 'sdl2'
-- checking for module 'jansson>=2.2'
--   found jansson, version 2.6
CMake Error at cmake/util.cmake:22 (LIST):
  list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
  lib/jansson/CMakeLists.txt:10 (ADD_IMPORTED_LIB)


-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for dlsym
-- Looking for dlsym - not found
-- Looking for dlsym in dl
-- Looking for dlsym in dl - found
-- Doing configuration specific to gcc...
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   system
--   iostreams
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Doing configuration specific to gcc...
-- Found Lua51: /usr/lib64/liblua5.1.so;/usr/lib64/libm.so
-- Boost version: 1.55.0
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   system
--   iostreams
--   regex
-- CXX target code cotired without unity build excluding 24 files.
-- Boost version: 1.55.0
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.7")
-- Configuring incomplete, errors occurred!
See also "/home/tobias/dev/fs2/fs2-blink/build/CMakeFiles/CMakeOutput.log".
See also "/home/tobias/dev/fs2/fs2-blink/build/CMakeFiles/CMakeError.log".

[attachment kidnapped by pirates]
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 04, 2014, 11:04:12 am
The issues with ADD_IMPORTED_LIB have (hopefully  :nervous:) been fixed in the main CMake branch but I didn't bother porting it to the chromium branch as the current version will not build under linux, sorry...
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: ngld on July 04, 2014, 11:54:13 am
You're right, the issues with ADD_IMPORTED_LIB are fixed in the cmake branch, however I've found some more issues:
I can only compile with "-DFSO_USE_LUAJIT=ON" otherwise the compiler will complain about missing lua_... functions. It seems that the lua headers aren't included.
The compiler still aborts (at least in the release configuration) because freespace.cpp is compiled without -DNDEBUG and won't link with libcode.a. Adding "ADD_DEFINITIONS(-DNDEBUG)" to one of the CMake files fixes this but it'll break the debug build.

Launching the compiled fs2_open_3_7_1_AVX file opens a window telling me "Unrecognized command line parameter --nograb." (even though I didn't pass any parameter) and crashes.

Valgrind output:
Code: [Select]
==31989== Invalid read of size 8
==31989==    at 0x6514A0: io::mouse::Cursor::enable() (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x651A4C: io::mouse::CursorManager::init() (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x5A8944: gr_init(int, int, int, int) (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x516C19: game_init() (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x517151: game_main(int, char**) (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x517477: actual_main(int, char**) (in /home/ngld/dev/fs2/fs2-blink/build/bin/fs2_open_3_7_1_AVX)
==31989==    by 0x7746FFF: (below main) (in /usr/lib/libc-2.19.so)
==31989==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Is there a dedicated thread / mantis issue for the cmake branch? Anything that I missed (cmake options or whatever) ?

EDIT: The crash was because I wasn't in my FSO directory. Shouldn't it output the "Web cursor bitmap not found. [...]" message instead of crashing?
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 04, 2014, 12:03:10 pm
The first issue may be related to your system libraries as by default CMake will use the system libraries. Try passing -DFSO_BUILD_INCLUDED_LIBS=On to cmake and it will compile the libraries distributed with the FSO code.
I know about NDEBUG error but I didn't fix it in that branch yet.
The last error looks like a general Antipodes issue, can you compile and run the antipodes SVN branch and report the results on the Antipodes thread in the Test forum?

There is no public CMake branch post but you could try using the github issue tracker in my repository if you find more issues.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: Sandwich on July 04, 2014, 03:05:13 pm
Just to give an idea of some cool button effects that can be achieved with CSS: http://tympanus.net/Development/CreativeButtons/ (check out their other demos - they've got some great stuff there).

EDIT: This too: http://tympanus.net/Development/CreativeLinkEffects/
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: ngld on July 04, 2014, 05:17:22 pm
So passing either -DLUA_INCLUDE_DIR=/usr/include/lua5.1 or -DFSO_BUILD_INCLUDED_LIBS=On works. I've installed lua 5.2 and lua 5.1 and somehow CMake finds the correct library but not the include directory.
gcc complains about "enum GameState;" in freespace2/freespace.h because the enum wasn't declared before. Replacing that line with
Code: [Select]
#include "gamesequence/gamesequence.h" fixes the problem.

Right now I'm compiling CEF because the binary build on their website links against libudev.so.0 but I have libudev.so.1. The build is already taking > 30 minutes and it's still downloading more stuff (with 4 MB/s).
I'm wondering if we'll have to provide several Linux builds depending on your OS flavour once this is part of FSO...  >.<

m!m, your GitHub repository is https://github.com/asarium/fs2open.github.com/tree/feature/chromiumInput, right? Since the issue tracker isn't enabled...

EDIT: After compiling chromium itself the CEF build failed because my gcc apparently isn't compatible with the gold linker CEF uses.... ugh.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 05, 2014, 01:23:52 am
Thanks for solving that enum issue, I think you can post pull requests to my repository with github so could you do that with your changes, that would make my life easier.

The libudev issue is apparently a known issue, here is a github issue that apparently solved the issue: https://github.com/adobe/brackets/issues/4720

I just enabled the issue tracker in my repository, thanks for pointing that out.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 13, 2014, 04:59:42 pm
Thanks to the effort of ngld you can now test on linux. The building process on Windows also got improved which means you can now build the project without much effort.
The first post has been updated to describe what you have to do.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: ngld on July 13, 2014, 05:04:42 pm
Quote from: m!m
Only use the 32-bit versions, FSO doesn't support 64-bit yet

It doesn't? I've been using 64-bit builds for at least 2 years and never had any problems (on Linux).
Compiling 32-bit builds on a 64-bit Linux distro can be a pain so I'd suggest trying to compile a 64-bit version first.
Title: Re: Internet Browser in FSO WIP (+Test builds)
Post by: m!m on July 14, 2014, 03:07:59 am
That only applies to windows, I changed the instructions accordingly, thank you.