code cleanup: remove $Id's that crept back in, also osl style edits

This commit is contained in:
Campbell Barton 2012-10-23 11:47:23 +00:00
parent b518197db7
commit 9c58865d20
13 changed files with 38 additions and 50 deletions

@ -27,7 +27,7 @@ shader node_convert_from_normal(
output point Point = point(0.0, 0.0, 0.0))
{
Val = (Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0);
ValInt = (int)((Normal[0] + Normal[1] + Normal[2])*(1.0/3.0));
ValInt = (int)((Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0));
Vector = vector(Normal[0], Normal[1], Normal[2]);
Color = color(Normal[0], Normal[1], Normal[2]);
Point = point(Normal[0], Normal[1], Normal[2]);

@ -27,7 +27,7 @@ shader node_convert_from_point(
output normal Normal = normal(0.0, 0.0, 0.0))
{
Val = (Point[0] + Point[1] + Point[2]) * (1.0 / 3.0);
ValInt = (int)((Normal[0] + Normal[1] + Normal[2])*(1.0/3.0));
ValInt = (int)((Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0));
Vector = vector(Point[0], Point[1], Point[2]);
Color = color(Point[0], Point[1], Point[2]);
Normal = normal(Point[0], Point[1], Point[2]);

@ -27,7 +27,7 @@ shader node_convert_from_vector(
output normal Normal = normal(0.0, 0.0, 0.0))
{
Val = (Vector[0] + Vector[1] + Vector[2]) * (1.0 / 3.0);
ValInt = (int)((Normal[0] + Normal[1] + Normal[2])*(1.0/3.0));
ValInt = (int)((Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0));
Color = color(Vector[0], Vector[1], Vector[2]);
Point = point(Vector[0], Vector[1], Vector[2]);
Normal = normal(Vector[0], Vector[1], Vector[2]);

@ -23,7 +23,7 @@ color image_texture_lookup(string filename, string color_space, float u, float v
{
color rgb = (color)texture(filename, u, 1.0 - v, "wrap", "periodic", "alpha", Alpha);
if(color_space == "sRGB")
if (color_space == "sRGB")
rgb = color_srgb_to_scene_linear(rgb);
return rgb;
@ -38,10 +38,10 @@ shader node_image_texture(
output color Color = color(0.0, 0.0, 0.0),
output float Alpha = 1.0)
{
if(projection == "Flat") {
if (projection == "Flat") {
Color = image_texture_lookup(filename, color_space, Vector[0], Vector[1], Alpha);
}
else if(projection == "Box") {
else if (projection == "Box") {
/* object space normal */
vector Nob = transform("world", "object", N);
@ -57,44 +57,44 @@ shader node_image_texture(
* the Nxyz values are the barycentric coordinates in an equilateral
* triangle, which in case of blending, in the middle has a smaller
* equilateral triangle where 3 textures blend. this divides things into
* 7 zones, with an if() test for each zone */
* 7 zones, with an if () test for each zone */
vector weight = vector(0.0, 0.0, 0.0);
float blend = projection_blend;
float limit = 0.5*(1.0 + blend);
/* first test for corners with single texture */
if(Nob[0] > limit*(Nob[0] + Nob[1]) && Nob[0] > limit*(Nob[0] + Nob[2])) {
if (Nob[0] > limit*(Nob[0] + Nob[1]) && Nob[0] > limit*(Nob[0] + Nob[2])) {
weight[0] = 1.0;
}
else if(Nob[1] > limit*(Nob[0] + Nob[1]) && Nob[1] > limit*(Nob[1] + Nob[2])) {
else if (Nob[1] > limit*(Nob[0] + Nob[1]) && Nob[1] > limit*(Nob[1] + Nob[2])) {
weight[1] = 1.0;
}
else if(Nob[2] > limit*(Nob[0] + Nob[2]) && Nob[2] > limit*(Nob[1] + Nob[2])) {
else if (Nob[2] > limit*(Nob[0] + Nob[2]) && Nob[2] > limit*(Nob[1] + Nob[2])) {
weight[2] = 1.0;
}
else if(blend > 0.0) {
else if (blend > 0.0) {
/* in case of blending, test for mixes between two textures */
if(Nob[2] < (1.0 - limit)*(Nob[1] + Nob[0])) {
weight[0] = Nob[0]/(Nob[0] + Nob[1]);
weight[0] = clamp((weight[0] - 0.5*(1.0 - blend))/blend, 0.0, 1.0);
if (Nob[2] < (1.0 - limit)*(Nob[1] + Nob[0])) {
weight[0] = Nob[0] / (Nob[0] + Nob[1]);
weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0);
weight[1] = 1.0 - weight[0];
}
else if(Nob[0] < (1.0 - limit)*(Nob[1] + Nob[2])) {
weight[1] = Nob[1]/(Nob[1] + Nob[2]);
weight[1] = clamp((weight[1] - 0.5*(1.0 - blend))/blend, 0.0, 1.0);
else if (Nob[0] < (1.0 - limit)*(Nob[1] + Nob[2])) {
weight[1] = Nob[1] / (Nob[1] + Nob[2]);
weight[1] = clamp((weight[1] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0);
weight[2] = 1.0 - weight[1];
}
else if(Nob[1] < (1.0 - limit)*(Nob[0] + Nob[2])) {
weight[0] = Nob[0]/(Nob[0] + Nob[2]);
weight[0] = clamp((weight[0] - 0.5*(1.0 - blend))/blend, 0.0, 1.0);
else if (Nob[1] < (1.0 - limit) * (Nob[0] + Nob[2])) {
weight[0] = Nob[0] / (Nob[0] + Nob[2]);
weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0);
weight[2] = 1.0 - weight[0];
}
else {
/* last case, we have a mix between three */
weight[0] = ((2.0 - limit)*Nob[0] + (limit - 1.0))/(2.0*limit - 1.0);
weight[1] = ((2.0 - limit)*Nob[1] + (limit - 1.0))/(2.0*limit - 1.0);
weight[2] = ((2.0 - limit)*Nob[2] + (limit - 1.0))/(2.0*limit - 1.0);
weight[0] = ((2.0 - limit) * Nob[0] + (limit - 1.0)) / (2.0 * limit - 1.0);
weight[1] = ((2.0 - limit) * Nob[1] + (limit - 1.0)) / (2.0 * limit - 1.0);
weight[2] = ((2.0 - limit) * Nob[2] + (limit - 1.0)) / (2.0 * limit - 1.0);
}
}
@ -103,15 +103,15 @@ shader node_image_texture(
float tmp_alpha;
if(weight[0] > 0.0) {
if (weight[0] > 0.0) {
Color += weight[0]*image_texture_lookup(filename, color_space, Vector[1], Vector[2], tmp_alpha);
Alpha += weight[0]*tmp_alpha;
}
if(weight[1] > 0.0) {
if (weight[1] > 0.0) {
Color += weight[1]*image_texture_lookup(filename, color_space, Vector[0], Vector[2], tmp_alpha);
Alpha += weight[1]*tmp_alpha;
}
if(weight[2] > 0.0) {
if (weight[2] > 0.0) {
Color += weight[2]*image_texture_lookup(filename, color_space, Vector[1], Vector[0], tmp_alpha);
Alpha += weight[2]*tmp_alpha;
}

@ -29,9 +29,9 @@ shader node_light_falloff(
float strength = Strength;
getattribute("std::ray_length", ray_length);
if(Smooth > 0.0) {
if (Smooth > 0.0) {
float squared = ray_length*ray_length;
strength *= squared/(Smooth + squared);
strength *= squared / (Smooth + squared);
}
/* Quadratic */

@ -1,4 +1,3 @@
# $Id: CMakeLists.txt 31746 2010-09-04 05:31:25Z joeedh $
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or

@ -1,4 +1,3 @@
# $Id: CMakeLists.txt 14444 2008-04-16 22:40:48Z hos $
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or

@ -195,6 +195,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
TIMEIT_END(decim);
#endif
CDDM_calc_normals(result);
return result;
}

@ -1,6 +1,4 @@
/*
* $Id: CMP_math.c 36271 2011-04-21 13:11:51Z campbellbarton $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or

@ -1,6 +1,4 @@
/*
* $Id: CMP_math.c 36271 2011-04-21 13:11:51Z campbellbarton $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or

@ -1,4 +1,3 @@
# $Id: CMakeLists.txt 14444 2008-04-16 22:40:48Z hos $
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or

@ -1,6 +1,4 @@
/*
* $Id: KX_PythonMain.cpp 37750 2011-06-27 09:27:56Z sjoerd $
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@ -17,15 +15,11 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
* Contributor(s): Benoit Bolsee
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file gameengine/Ketsji/KX_PythonMain.cpp
* \ingroup ketsji
*/

@ -1,6 +1,4 @@
/*
* $Id: KX_PythonMain.h 37750 2011-06-27 09:27:56Z sjoerd $
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@ -31,11 +29,12 @@
* \ingroup ketsji
*/
#ifndef __KX_PYTHON_MAIN
#define __KX_PYTHON_MAIN
#ifndef __KX_PYTHON_MAIN__
#define __KX_PYTHON_MAIN__
#include "BKE_main.h"
#include "DNA_scene_types.h"
extern "C" char *KX_GetPythonMain(struct Scene* scene);
extern "C" char *KX_GetPythonCode(struct Main *main, char *python_main);
#endif
#endif /* __KX_PYTHON_MAIN__ */