UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Submit Patch #4740 Rewrote UFO:AI's GLSL Preprocessor
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Submit Patch
  • Category
    General
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    3. Normal
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/patches/613 Item 613] imported from sourceforge.net tracker on 2013-01-28 20:46:59

I've been doing some work in the GLSL shaders, but ran into issues where nested conditional structures were not being parsed correctly by the UFO:AI GLSL Preprocessor. So I rewrote it. I hope it is acceptable. If there are any issues I would be happy to address them.

i.e. structures like this were not being parsed correctly:
#if r_postprocessing
#ifndef FOO
#define FOO
#else
#if r_fog
#define BAR
#endif
#endif
#else
#define BAR
#endif

With this patch they will be (to the extent I've tested it with the existing shaders & my shaders to date).

Thanks!
===== Comments Ported from Sourceforge =====

====== andrewusu (2011-06-07 11:51:33) ======

My indentation was scraped by this web site :) In the commit message it is indented properly.
====== tlh2000 (2011-06-07 21:06:50) ======

thanks for the patch. this code does not meet our coding guidelines though.
====== andrewusu (2011-06-08 11:18:33) ======

I didn't notice the if/else structures didn't meet UFOAI's coding guidelines earlier. I've fixed that. Anything else?

I deleted the patch that didn't meet the guidelines. I've attached my changes in two forms, as 2 patches, and as 1 composite patch. The 2nd patch in the 2 patches file consists of my changes since your disapproval.
====== tlh2000 (2011-06-08 13:30:18) ======

thanks a lot - some more notes:

if(out && qtrue == writeEndifToOut) {

if (out ....
^^ a whitespace is missing here and at a lot of other if statements

qtrue == variable
^^ should be just "variable", as this is already a boolean, the same is for qfalse == variable - this should just be !variable

if(out)
{
^^ should be if (out) {
====== andrewusu (2011-06-10 11:49:24) ======

All right, I've attached a single patch off of master with the fixes.
====== andrewusu (2011-06-10 21:52:15) ======

Eeek! No don't use that last one, I merged it wrong. Just a sec...
====== andrewusu (2011-06-10 21:57:47) ======

Fixed the merge problem.
====== andrewusu (2011-06-10 21:58:07) ======

Ok now it is good; sorry about that.
====== tlh2000 (2011-06-11 06:40:08) ======

another question is about the shaders - can you attach them, too? what are you working on there?
====== tlh2000 (2011-06-11 06:46:09) ======

Applied to master - thanks
====== andrewusu (2011-06-11 11:24:59) ======

I'd like to work more on the shaders first before attaching them.

Getting GLSL versions 1.3 & 1.5 supported with no errors/warnings. Fixing a couple other problems too. I'm in the process of learning.

Oh, turns out I didn't fix every merge problem... it had been a while since I used merge. The "Mem_Free(buffer);" call should be moved from line 490 to between lines 492 and 493. Sorry about that... I'll post a bug fix with a patch and link to it with a comment here shortly.
====== andrewusu (2011-06-11 11:36:27) ======

All right, here is the bug fix to the Mem_Free call being in the wrong spot: https://sourceforge.net/tracker/?func=detail&aid=3315048&group_id=157793&atid=805242
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif