Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch files to regular ASCII #9

Open
wants to merge 1 commit into
base: spark2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions demos/src/DX9/BasicDemoDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ int Run()

void InitializeConsoleStdIO()
{
// si une console est rattach�e au processus, alors il existe des fichiers
// si une console est rattachee au processus, alors il existe des fichiers
// virtuel CONIN$ et CONOUT$ qui permettent respectivement de lire
// et d'�crire depuis / dans cette console (voir la doc de CreateFile).
// et d'ecrire depuis / dans cette console (voir la doc de CreateFile).

#if _MSC_VER >= 1400 // VC++ 8
{
// �viter le warning C4996: 'freopen' was declared deprecated
// eviter le warning C4996: 'freopen' was declared deprecated
// This function or variable may be unsafe. Consider using freopen_s instead.
FILE *stream;
freopen_s( &stream, "CONIN$", "r", stdin );
Expand Down Expand Up @@ -513,7 +513,7 @@ LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

case WM_MOUSEMOVE:
{
// d�placement relatif
// deplacement relatif
int px = GET_X_LPARAM(lParam);
int py = GET_Y_LPARAM(lParam);

Expand Down Expand Up @@ -551,4 +551,4 @@ LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
return 0;
}
}
8 changes: 4 additions & 4 deletions demos/src/DX9/BasicDemoDXUT9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ D3DLIGHT9 g_light;
#ifdef CONSOLE
void InitializeConsoleStdIO()
{
// si une console est rattach�e au processus, alors il existe des fichiers
// si une console est rattachee au processus, alors il existe des fichiers
// virtuel CONIN$ et CONOUT$ qui permettent respectivement de lire
// et d'�crire depuis / dans cette console (voir la doc de CreateFile).
// et d'ecrire depuis / dans cette console (voir la doc de CreateFile).

#if _MSC_VER >= 1400 // VC++ 8
{
// �viter le warning C4996: 'freopen' was declared deprecated
// eviter le warning C4996: 'freopen' was declared deprecated
// This function or variable may be unsafe. Consider using freopen_s instead.
FILE *stream;
freopen_s( &stream, "CONIN$", "r", stdin );
Expand Down Expand Up @@ -836,4 +836,4 @@ void CALLBACK MouseProc( bool bLeftButtonDown, bool bRightButtonDown, bool bMidd
}
}
//*/
}
}
4 changes: 2 additions & 2 deletions demos/src/DX9/CCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <d3dx9.h>

////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Camera. classe de base pour la gestion des cam�ras</summary>
/// <summary> Camera. classe de base pour la gestion des cameras</summary>
///
////////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -40,7 +40,7 @@ class CCamera
};

////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Global camera. cam�ra regardant l'origine du monde, sa position se trouvant sur une sph�re</summary>
/// <summary> Global camera. camera regardant a l'origine du monde, sa position se trouvant sur une sphere</summary>
///
////////////////////////////////////////////////////////////////////////////////////////////////////

Expand Down
8 changes: 4 additions & 4 deletions demos/src/DX9/GravitationDemoDXUT9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ bool bounceOnFloor(Particle& particle, float deltaTime)
#ifdef CONSOLE
void InitializeConsoleStdIO()
{
// si une console est rattach�e au processus, alors il existe des fichiers
// si une console est rattachee au processus, alors il existe des fichiers
// virtuel CONIN$ et CONOUT$ qui permettent respectivement de lire
// et d'�crire depuis / dans cette console (voir la doc de CreateFile).
// et d'ecrire depuis / dans cette console (voir la doc de CreateFile).

#if _MSC_VER >= 1400 // VC++ 8
{
// �viter le warning C4996: 'freopen' was declared deprecated
// eviter le warning C4996: 'freopen' was declared deprecated
// This function or variable may be unsafe. Consider using freopen_s instead.
FILE *stream;
freopen_s( &stream, "CONIN$", "r", stdin );
Expand Down Expand Up @@ -898,4 +898,4 @@ void CALLBACK MouseProc( bool bLeftButtonDown, bool bRightButtonDown, bool bMidd
}
}
//*/
}
}
8 changes: 4 additions & 4 deletions demos/src/DX9/RainDemoDXUT9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ bool killRain(Particle& particle, float deltaTime)
#ifdef CONSOLE
void InitializeConsoleStdIO()
{
// si une console est rattach�e au processus, alors il existe des fichiers
// si une console est rattachee au processus, alors il existe des fichiers
// virtuel CONIN$ et CONOUT$ qui permettent respectivement de lire
// et d'�crire depuis / dans cette console (voir la doc de CreateFile).
// et d'ecrire depuis / dans cette console (voir la doc de CreateFile).

#if _MSC_VER >= 1400 // VC++ 8
{
// �viter le warning C4996: 'freopen' was declared deprecated
// eviter le warning C4996: 'freopen' was declared deprecated
// This function or variable may be unsafe. Consider using freopen_s instead.
FILE *stream;
freopen_s( &stream, "CONIN$", "r", stdin );
Expand Down Expand Up @@ -1097,4 +1097,4 @@ void CALLBACK MouseProc( bool bLeftButtonDown, bool bRightButtonDown, bool bMidd
}
}
//*/
}
}
2 changes: 1 addition & 1 deletion include/Core/SPK_Octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace SPK
* When a octree is attached to a group, at each update, every individual particle is processed and put into cells.<br>
* Particles become therefore aware of their neighbors.<br>
* <br>
* Octrees allows optimization of algorithms that run in O(n) by reducing their complexity to O(nlog(n)).<br>
* Octrees allows optimization of algorithms that run in O(n^2) by reducing their complexity to O(nlog(n)).<br>
* Typically algorithms where each particle is affected by every other particles in the group (particle vs particle collision, flocking, nbody simulations...).<br>
* <br>
* A Octree is automatically generated within a group if at least one of its modifiers needs it (by setting its NEEDS_OCTREE constant to true at init).<br>
Expand Down
4 changes: 2 additions & 2 deletions include/Extensions/Modifiers/SPK_LinearForce.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ namespace SPK
* <li>FACTOR_QUADRATIC : the surface of the particle is used and the squared speed is used (the best discrete approximation of the reality)</li>
* <li>FACTOR_CUBIC : the volume of the particle is used but it has no physical sense</li>
* </ul>
* The correct formula is : <i>f = 0.5 * volumetric density of the fluid * surface * speed</i><br>
* The correct formula is : <i>f = 0.5 * volumetric density of the fluid * surface * speed^2</i><br>
* The coefficient can then be set to give realistic winds depending of the shape of the particle and on the fluid. <br>
* For instance for a sphere in the air we have :
* <ul>
* <li>volumetric density of the air : 1.293 kg.m^-3</li>
* <li>surface of sphere in contact with the wind : PI * r * r m<li>
* <li>surface of sphere in contact with the wind : PI * r * r m^2<li>
* </ul>
* Therefore, the coefficient will be 0.5 * 1.293 * 3.14159 = 2.03
*
Expand Down
4 changes: 2 additions & 2 deletions src/Rendering/DX9/SPK_DX9_Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace DX9
DX9Info::getDevice()->CreateVertexBuffer(nbVertices*sizeof(D3DXVECTOR3), D3DUSAGE_DYNAMIC, D3DFVF_XYZ, D3DPOOL_DEFAULT, &vertexBuffer, NULL);
DX9Info::getDevice()->CreateVertexBuffer(nbVertices*sizeof(D3DCOLOR), D3DUSAGE_DYNAMIC, D3DFVF_DIFFUSE, D3DPOOL_DEFAULT, &colorBuffer, NULL);

// TODO : g�rer les indices 32bit
// TODO : gerer les indices 32bit
if( nbIndices > 0 )
{
DX9Info::getDevice()->CreateIndexBuffer(nbIndices*sizeof(short), 0, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &indexBuffer, 0);
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace DX9
unlock();
}

// TODO : g�rer autre chose que les textures 2D
// TODO : gerer autre chose que les textures 2D
if(nbTexCoords > 0)
DX9Info::getDevice()->CreateVertexBuffer(nbVertices*sizeof(D3DXVECTOR2), D3DUSAGE_DYNAMIC, D3DFVF_TEX1|D3DFVF_TEXCOORDSIZE1(nbTexCoords), D3DPOOL_DEFAULT, &texCoordBuffer, NULL);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Rendering/DX9/SPK_DX9_PointRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ namespace DX9

void DX9PointRenderer::enablePointParameter(float size,bool distance)
{
// derived size = size * sqrt(1 / (A + B * distance + C * distance))
// derived size = size * sqrt(1 / (A + B * distance + C * distance^2))
if (distance)
{
const float sqrtC = POINT_SIZE_CURRENT / (size * pixelPerUnit);
const float QUADRATIC_WORLD[3] = {0.0f,0.0f,sqrtC * sqrtC}; // A = 0; B = 0; C = (POINT_SIZE_CURRENT / (size * pixelPerUnit))
const float QUADRATIC_WORLD[3] = {0.0f,0.0f,sqrtC * sqrtC}; // A = 0; B = 0; C = (POINT_SIZE_CURRENT / (size * pixelPerUnit))^2
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_A, FtoDW(QUADRATIC_WORLD[0]));
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_B, FtoDW(QUADRATIC_WORLD[1]));
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_C, FtoDW(QUADRATIC_WORLD[2]));
}
else
{
const float sqrtA = POINT_SIZE_CURRENT / size;
const float QUADRATIC_WORLD[3] = {sqrtA * sqrtA,0.0f,0.0f}; // A = (POINT_SIZE_CURRENT / size); B = 0; C = 0
const float QUADRATIC_WORLD[3] = {sqrtA * sqrtA,0.0f,0.0f}; // A = (POINT_SIZE_CURRENT / size)^2; B = 0; C = 0
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_A, FtoDW(QUADRATIC_WORLD[0]));
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_B, FtoDW(QUADRATIC_WORLD[1]));
DX9Info::getDevice()->SetRenderState(D3DRS_POINTSCALE_C, FtoDW(QUADRATIC_WORLD[2]));
Expand Down
4 changes: 2 additions & 2 deletions src/Rendering/OpenGL/SPK_GL_PointRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ namespace GL
if (worldSize)
{
#ifndef SPK_GL_NO_EXT
// derived size = size * sqrt(1 / (A + B * distance + C * distance))
// derived size = size * sqrt(1 / (A + B * distance + C * distance^2))
const float POINT_SIZE_CURRENT = 32.0f;
const float POINT_SIZE_MIN = 1.0f;
const float POINT_SIZE_MAX = 1024.0f;
const float sqrtC = POINT_SIZE_CURRENT / (group.getGraphicalRadius() * worldScale * 2.0f * pixelPerUnit);
const float QUADRATIC_WORLD[3] = {0.0f,0.0f,sqrtC * sqrtC}; // A = 0; B = 0; C = (POINT_SIZE_CURRENT / (size * pixelPerUnit))
const float QUADRATIC_WORLD[3] = {0.0f,0.0f,sqrtC * sqrtC}; // A = 0; B = 0; C = (POINT_SIZE_CURRENT / (size * pixelPerUnit))^2
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,QUADRATIC_WORLD);
glPointSize(POINT_SIZE_CURRENT);
glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT,POINT_SIZE_MIN);
Expand Down