]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
An attempt to fix the particle color bug (it coudlnt read hex values).
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 10 Apr 2006 20:41:57 +0000 (20:41 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 10 Apr 2006 20:41:57 +0000 (20:41 +0000)
Also extend it to make it support "R G B" color pairs.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6263 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index 72d4d8caa564b87c6d6572e279967fbbcdbb90f4..d4e1428a5f861d969b228fe02a17b6f720e5f50e 100644 (file)
@@ -293,7 +293,15 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend)
                        else if (!strcmp(argv[1], "entityparticle")) info->particletype = pt_entityparticle;
                        else Con_Printf("effectinfo.txt:%i: unrecognized particle type %s\n", linenumber, argv[1]);
                }
-               else if (!strcmp(argv[0], "color")) {readints(info->color, 2);}
+               else if (!strcmp(argv[0], "color")) 
+               {
+                       unsigned color[6] = {0};
+                       checkparms(3);
+                       sscanf( argv[1], "%i %i %i", &color[0], &color[1], &color[2] );
+                       sscanf( argv[2], "%i %i %i", &color[3], &color[4], &color[5] );
+                       info->color[0] = color[0] + (color[1] << 8) + (color[2] << 16);
+                       info->color[1] = color[3] + (color[4] << 8) + (color[5] << 16);
+               }
                else if (!strcmp(argv[0], "tex")) {readints(info->tex, 2);}
                else if (!strcmp(argv[0], "size")) {readfloats(info->size, 2);}
                else if (!strcmp(argv[0], "alpha")) {readfloats(info->alpha, 3);}