eWallRim::Bound

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

You can change the floor normal. :)
Attachments
floornormal.png
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Code: Select all

../../../armagetronad/src/tron/gCycle.cpp: In member function `virtual void gCycle::Render(const eCamera*)':
../../../armagetronad/src/tron/gCycle.cpp:2073: error: `glProgramStringARB' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2073: error: (Each undeclared identifier is reported only once for each function it appears in.)
../../../armagetronad/src/tron/gCycle.cpp:2076: error: `glProgramLocalParameter4fARB' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2106: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2106: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2106: error: `error' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2106: error: expected `;' before "error"
../../../armagetronad/src/tron/gCycle.cpp:2126: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2126: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2126: error: expected `;' before "error"
make[1]: *** [gCycle.o] Error 1
make[1]: Leaving directory `/home/dave/Projects/aabuild/src/tron'
make: *** [armagetronad] Error 2
[dave@ghostwheel aabuild]$ 
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

Jonathan wrote:And the winzone is green. :D
Just like in CVS... o.O;;
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Lucifer: Update your GL header (and implementation?) and #define DONTDOIT.
Luke-Jr: At least when I changed it it was always red.
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Jonathan wrote:Lucifer: Update your GL header (and implementation?) and #define DONTDOIT.
Umm, that's probably not going to work, then. I'm running the absolute newest version of Mandriva Linux, it's not like I'm running something ancient.

Furthermore, I was able to grep those functions in /usr/include, so they're their, just for some reason even when I include the files those are in the thing doesn't compile.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

It's probably in glext.h. And did you include gArena.h? (as with the old lines version)
ˌɑrməˈɡɛˌtrɑn
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Replying to Lucifer in the other thread: Here are solutions based on the errors LETE pmed me:
- headlights undeclared: add a config option or remove the if.
- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
- GL stuff undeclared: include glext.h.
- M_SQRT2 undeclared: #define as the square root of 2 (1.41421356237309504880168872420969808).
- Stuff after '#' errors: #define DONTDOIT somewhere at the top.
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Jonathan wrote:Replying to Lucifer in the other thread: Here are solutions based on the errors LETE pmed me:
- headlights undeclared: add a config option or remove the if.
I already did that. :)
- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
That's in.....rRender or something? I'll grep it.
- GL stuff undeclared: include glext.h.
That didn't work, but I'll try it again.
- Stuff after '#' errors: #define DONTDOIT somewhere at the top.
Ok, I'll try it and give it whirl.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Lucifer wrote:
Jonathan wrote:- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
That's in.....rRender or something? I'll grep it.
You probably already grepped it, but it's in rScreen.
- GL stuff undeclared: include glext.h.
That didn't work, but I'll try it again.
I expect the fragment program stuff to be in there.

Btw, it's a good idea to check if you have the ARB_fragment_program extension (look in glGetString(GL_EXTENSIONS)) before trying to run it.
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Ok, the GL stuff that's undeclared is in fact declared in SDL_opengl.h.

Anyone got any ideas? :( I'm at a loss for it....

On the bright side, though, my particle system is working after all, it's just putting 100 particles all in the same place, so it's very hard to see. Lemme commit my changes real quick and then I'll try to randomize the particle start locations a little.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
LETE
Core Dumper
Posts: 128
Joined: Sat May 21, 2005 5:40 am
Location: Hey if i'm not here i'm most likely on the grid

Post by LETE »

well, once you include that what do you get? could you post your errors? I lost everything I had going last night, which is bogus, because I was down to like 2 errors.
Image
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Sorry LETE, my errors are already posted because, well, you see, SDL_opengl.h is what armagetron has already included. :) So the previous errors are still there. They're there regardless of what files I include. If I do #include <glext.h>, I get an error can't find the file. If I do #include <GL/glext.h>, no error about can't find the file. Not that it matters since that function is in SDL_opengl.h after all, which is already being included. Look at rGL.h to see where it's being included from. To see which files depend on that one header, add a blank line to it and recompile. :)

It's looking like a namespace issue, but it's been so long since I've seen a namespace problem in c++ that I don't even remember what it looks like in the compiler output (and it was gcc pre-3.0 I might add). But if the function declaration is in the header being included, then there's a reason it's not being hit, like maybe a #define that's needed before the include or something like that....
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

please post a diff :o
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

nemostultae wrote:please post a diff :o
Attachments
headlightdiff.diff.zip
untested patch generated against current cvs
(1.93 KiB) Downloaded 173 times
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

No diff because I made many unrelated changes too, but this is all extra code for the headlights in gCycle.cpp:

Code: Select all

#define DONTDOIT

#include "gArena.h"

bool cycleprograminited = false; // extern it in rScreen.cpp, set to false in sr_InitDisplay

static bool headlights = true;
static tConfItem<bool> headlightsconf("HEADLIGHTS", headlights);

AFTER THE COMPOUND STATEMENT CONTAINING if ( renderPyramid )

              if(headlights) {
                      glBlendFunc(GL_ONE, GL_ONE);
                      glDepthMask(GL_FALSE);

                      if(!cycleprograminited) {
                              const char *program =
"!!ARBfp1.0\
\
PARAM normal = program.local[0];\
ATTRIB texcoord = fragment.texcoord;\
TEMP final, diffuse, distance;\
\
DP3 distance, texcoord, texcoord;\
RSQ diffuse, distance.w;\
RCP distance, distance.w;\
MUL diffuse, texcoord, diffuse;\
DP3 diffuse, diffuse, normal;\
MUL final, diffuse, distance;\
MOV result.color.w, fragment.color;\
MUL result.color.xyz, fragment.color, final;\
\
END";
                              glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(program), program);
                              cycleprograminited = true;
                      }
                      glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 0, 0, speed * speed, 0);
                      glEnable(GL_FRAGMENT_PROGRAM_ARB);

                      const unsigned sensors = 32;
                      const double mul = 0.25 * M_PI / sensors;
                      const double add = -0.125 * M_PI;

                      double size = gArena::SizeMultiplier() * 500 * M_SQRT2;
                      GLfloat array[sensors+2][5];

                      array[0][0] = 0;
                      array[0][1] = 0;
                      array[0][2] = p.x;
                      array[0][3] = p.y;
                      array[0][4] = 0.125;

                      for(unsigned i=0; i<=sensors; i++) {
                              gSensor sensor(this, p, dir.Turn(cos(i * mul + add), sin(i * mul + add)));
                              sensor.detect(size);
                              array[i][5] = sensor.before_hit.x - p.x;
                              array[i][6] = sensor.before_hit.y - p.y;
                              array[i][7] = sensor.before_hit.x;
                              array[i][8] = sensor.before_hit.y;
                              array[i][9] = 0.125;
                      }

                      glPushMatrix();
                      glLoadIdentity();

                      glMatrixMode(GL_TEXTURE);
                      glPushMatrix();
                      glTranslatef(0, 0, 1);

                      glColor3fv(reinterpret_cast<GLfloat *>(&color_));
                      glEnableClientState(GL_VERTEX_ARRAY);
                      glEnableClientState(GL_TEXTURE_COORD_ARRAY);

                      glInterleavedArrays(GL_T2F_V3F, 0, array);
                      glDrawArrays(GL_TRIANGLE_FAN, 0, sensors+2);

                      glDisableClientState(GL_VERTEX_ARRAY);
                      glDisableClientState(GL_TEXTURE_COORD_ARRAY);

                      glDisable(GL_FRAGMENT_PROGRAM_ARB);

                      glPopMatrix();
                      glMatrixMode(GL_MODELVIEW);

                      glPopMatrix();

                      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
                      glDepthMask(GL_TRUE);
              }
Edit: argh
ˌɑrməˈɡɛˌtrɑn
Post Reply