January 22, 2019, 01:10:36 AM

Author Topic: Problem compiling OpenB3D II  (Read 711 times)

Offline Krischan

  • Full Member
  • ***
  • Posts: 164
    • Krischan's Homepage
Problem compiling OpenB3D II
« on: September 03, 2018, 01:34:51 AM »
I have a question for Mark: does the current branch of OpenB3D now only compiles with Blitzmax NG or does it need a newer MinGW? I can't get it running in my Blitzmax setup anymore (which is not NG), but with the NG version it compiles. I'm getting this error when using the bmk makemods -a -d openb3dmax command which runs fine if I'm using the OpenB3D version from April 30, 2018:

Quote
Archiving:openb3dlib.debug.win32.x86.a
ar: creating c:/Apps/Coding/BlitzMax/mod/openb3dmax.mod/openb3dlib.mod/openb3dlib.debug.win32.x86.a
Compiling:openb3dmax.bmx
Compile Error: Expecting identifier
[c:/Apps/Coding/BlitzMax/mod/openb3dmax.mod/openb3dmax.mod/inc/TMD2.bmx;316;19]
Build Error: failed to compile c:/Apps/Coding/BlitzMax/mod/openb3dmax.mod/openb3dmax.mod/openb3dmax.bmx

It could be that my Blitzmax/MinGW setup is outdated, but it's a stable environment for BLIDE which I must use for my projects. BCC is "BlitzMax Release Version 1.50", FASM is "version 1.69.14", BMK version is "BaH 28/09/2007" (afaik), MinGW is tdm64-gcc-5.1.0-2.exe and I remember that I've setup BlitzmaxOS 1.52 a year ago and use this instead of the vanilla Blitzmax install. Any suggestions?
Kind regards
Krischan

Windows 10 Pro | iMac 27" Late 2013 [i7 4771 @ 3.5GHz | GTX 780M]
My Blitzbasic Archive | Extrasolar Project

Offline Derron

  • Hero Member
  • *****
  • Posts: 1557
Re: Problem compiling OpenB3D II
« Reply #1 on: September 03, 2018, 07:14:55 AM »
That line looks similar to:
Code: BlitzMax
  1. SuperStrict
  2.  
  3. local verts:int[]
  4. 'verts[] = New int[5]
  5. verts = New int[5]
  6.  

In other words:
Code: BlitzMax
  1. 'change
  2. frames[i].verts[]=New TMD2Vertex[num_vertices]
  3. 'to
  4. frames[i].verts = New TMD2Vertex[num_vertices]
  5.  
(affected file: c:/Apps/Coding/BlitzMax/mod/openb3dmax.mod/openb3dmax.mod/inc/TMD2.bmx Line 316)


PS: You should be able to replace "bmk" with a more current one - just to enable a local MinGW (you can put a copy in BlitzMax/MinGW32 or MinGWx86 ... so you can have a "portable Blitzmax+MinGW+modules" without affecting other development tool-setups)). The current BMK also does multithreaded compiling (.c files, BMK needs to be compiled "threaded" then). Also you can have "post.bmk" and "pre.bmk"-lua-scripts doing stuff before and after compilation (eg. removing old log files, increasing version number, ...).

bye
Ron

Offline Krischan

  • Full Member
  • ***
  • Posts: 164
    • Krischan's Homepage
Re: Problem compiling OpenB3D II
« Reply #2 on: September 03, 2018, 03:58:12 PM »
PS: You should be able to replace "bmk" with a more current one - just to enable a local MinGW (you can put a copy in BlitzMax/MinGW32 or MinGWx86

This isn't working. If I only change the BMK and rename the 5.x MinGW folder i'm getting "C:/Apps/Coding/BlitzMax/MinGW32x86/bin/ld.exe: cannot find -lunicows". If I add the new BCC too I'm getting a whole bunch of errors. Beside that the change affects all modules and I can switch to NG right away, but then I can't use BLIDE anymore (NG x86 works partly with BLIDE but it doesn't know the -w switch and has other disadvantages then).

I am not one of the experts who must control all features down to command-line level, I am just a hobby programmer who wants to realize his ideas without having to constantly struggle with the environment. A very stable setup was Blitzmax+miniB3D for example. There I never had any issues like that.

The question is: is it possible to use future versions of OpenB3D with the x86 BlitzmaxOS version and BLIDE or is it impossible?

EDIT: just want to mention that the last working OpenB3D version here is before June 1st 2018. After this date, none of the commits compiles anymore in my setup.
Kind regards
Krischan

Windows 10 Pro | iMac 27" Late 2013 [i7 4771 @ 3.5GHz | GTX 780M]
My Blitzbasic Archive | Extrasolar Project

Offline Derron

  • Hero Member
  • *****
  • Posts: 1557
Re: Problem compiling OpenB3D II
« Reply #3 on: September 03, 2018, 05:05:13 PM »
-lunicows

you need to copy the unicows-file
http://mojolabs.nz/posts.php?topic=95220

So the unicows.a file needs to get copied. Are you using XP or a newer OS?


@ BMK
If you just replace BMK with the newer one, it already fails - or only if you try to use a custom MinGW folder within BlitzMax?


bye
Ron

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 314
Re: Problem compiling OpenB3D II
« Reply #4 on: September 03, 2018, 10:13:29 PM »
Sorry Krischan, I never checked BRL/OS Max to see if it compiled for quite a while now, so yes it was broken (now fixed) and Derron's MD2 fix was correct, thanks dude! It also had another TSurface error where BRL Max can't automatically cast from Int Ptr to Float Ptr.

I also added a Size_T/Int fix to STBimageloader by Henri and a fix to T3DS not loading Sketchup 3ds files right, but I haven't got a file to test with so this is probably still not right.

Oh and you probably don't need a different version of BMK.

Offline Henri

  • Full Member
  • ***
  • Posts: 179
Re: Problem compiling OpenB3D II
« Reply #5 on: September 04, 2018, 08:32:42 AM »
Also, the original problem was not with MinGW, but a Blitzmax code issue, which derron's fix corrected I assume.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Krischan

  • Full Member
  • ***
  • Posts: 164
    • Krischan's Homepage
Re: Problem compiling OpenB3D II
« Reply #6 on: September 04, 2018, 03:05:40 PM »
Thanks guys, it compiles now, great ;D There is an interesting issue I've been facing which has been resolved by the new OpenB3D version:

As you know I'm currently working on a larger game project. Everything was fine and a few weeks ago I paused and worked on a different project. Then I wanted to add some features to the game and it was a total mess. My torchlight didn't work anymore and the shaders weren't working as expected. But it was the old source, the old environment and I always make a manual daily backup of my sourcecode changes and assets.

First I thought I've used a unfinished and untested version of my game or changed something in the meantime but after checking many backups all of the old compiled executables showed the same garbage on the screen. I didn't change anything on my system, no new graphics driver or something like that. It could be a Windows 10 update but I still can't explain what could have happened in the time range between July 6 and today. It affected the Createlight and the Shader functions somehow, perhaps an issue with the Texture FX but I still have no clue what the problem was. The code looks good and it already worked in the past.

See Attachment "A", this is ok and how it looked all the time (and now again) and Attachment "B" how it looked wrong. I'm using a second camera  above the player, grab a screenshot from it and apply it as a texture on the magic sphere with some blending and FX. The hand and the sphere are lighted by a second light. Everything is attached to the camera. What happened was that the main light initially was too bright and after turning it off and on again it was suddenly too faint and the minimap never appeared. The shaders worked so far but didn't get enough light anymore.

EDIT: strange, now the old executables work again. I think I start to hate Windows 10 "as a service". But I found another issue regarding the shaders in OpenB3D. When I unload a level I unload all loaded assets and shaders. After recreating the level, the additional loaded B3D models behave strange, sometimes they have no textures at all and sometimes I "see" the normalmap which shouldn't be visible at all. The level geometry which is recreated isn't affected at all. There must have been a major change regarding model loading I assume?
Kind regards
Krischan

Windows 10 Pro | iMac 27" Late 2013 [i7 4771 @ 3.5GHz | GTX 780M]
My Blitzbasic Archive | Extrasolar Project

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 314
Re: Problem compiling OpenB3D II
« Reply #7 on: September 05, 2018, 01:43:35 AM »
Quote
After recreating the level, the additional loaded B3D models behave strange, sometimes they have no textures at all and sometimes I "see" the normalmap which shouldn't be visible at all.
This sounds like the textures are not being freed from video memory and are reloaded in a wrong order, like Minib3d unique textures are only loaded once and have an index, i'm not sure how Opengl handles this but my guess is you may have to recreate the context to properly free the textures, that is Endgraphics and Graphics3d, i'll check this out.

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 314
Re: Problem compiling OpenB3D II
« Reply #8 on: September 05, 2018, 08:09:31 PM »
Okay, I think if you use ClearWorld it should fix it, if not then there must be a bug.

Offline Krischan

  • Full Member
  • ***
  • Posts: 164
    • Krischan's Homepage
Re: Problem compiling OpenB3D II
« Reply #9 on: September 10, 2018, 10:47:49 PM »
I've sent you a PM, the problem is more complex as the Clearworld is hard to implement without rewriting large parts of the game engine code. But perhaps there is another fix possible.

EDIT: added two screenshots how it looks initially and after loading a random map

Kind regards
Krischan

Windows 10 Pro | iMac 27" Late 2013 [i7 4771 @ 3.5GHz | GTX 780M]
My Blitzbasic Archive | Extrasolar Project