Forum

Mirror Textures

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Mirror Textures

Postby Rikku2000 » Mon May 02, 2011 7:21 am

Hey guys i want add some Mirror Textures in my Quake Engine so i have a look into the gl_rmisc.c and add some code:
Code: Select all
      if (Q_strncmp(cl.worldmodel->textures[i]->name,"window02_1",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_1",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_2",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_3",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_4",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_lava1_fbr",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_lava2_fbr",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_slime1",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_slime2",10))
         mirrortexturenum = i;
      /* else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_teleport",10))
         mirrortexturenum = i; */
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water0",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water1",10))
         mirrortexturenum = i;
      else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water2",10))
         mirrortexturenum = i;


But it dont work can anyone help me, thanks.
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Postby ceriux » Mon May 02, 2011 7:38 am

i'm not sure if this goes in qc.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Rikku2000 » Mon May 02, 2011 7:43 am

hmm i dont know... but the if i use without all the else ifs i can mirrow the texture
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Postby behind_you » Mon May 02, 2011 7:54 am

OSAMA BIN LADEN IS DEAD!!!!!!!!!!!!!!!



ahem............. sorry for that outburst.

1- this doesnt belong in the qc category, as ceriux said

2 - try bracing your code (ie the {} stuff). it gets code to work for me sometimes.

ps if u r using dp it wont work. mirroralpha in dp is broken last i checked.....
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Rikku2000 » Mon May 02, 2011 8:17 am

i will try, thanks.

PS: i use my own Quake engine for handheld devices.
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Postby behind_you » Mon May 02, 2011 8:28 am

Rikku2000 wrote:PS: i use my own Quake engine for handheld devices.



ooohhh :o what devices specifically? it must be really troublesome. i tried quake on my nokia 5230 and it was real sluggish.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Spike » Mon May 02, 2011 12:54 pm

the number on the right is the length of the string. any texture names longer than 10 chars will match regardless of either the texture name or whatever you're trying to match against.

also, you only have one mirrortexturenum. only one such texture will ever be a mirror on any individual map - whichever is the last texture found in the bsp. all the others will draw as normal.
also, make sure you have r_mirroralpha set to something less than 1.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Sajt » Mon May 02, 2011 5:44 pm

Also you should probably add a not before the Q_strncmp calls (!Q_strncmp).
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Rikku2000 » Mon May 02, 2011 10:24 pm

if (Q_strncmp(cl.worldmodel->textures[i]->name,"window02_1",10)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_1",10)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_2",10)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_3",10)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"window01_4",10)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_lava1_fbr",14)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_lava2_fbr",14)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_slime1",11)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_slime2",11)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_teleport",13)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water0",11)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water1",11)) {
mirrortexturenum = i;
} else if (Q_strncmp(cl.worldmodel->textures[i]->name,"star_water2",11)) {
mirrortexturenum = i;
}

so thats right? my Quake engine is for GP2X WIZ and Caanoo thats openhandheld device.
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Postby Spike » Tue May 03, 2011 12:15 am

read what sajt said
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest