removed dependency on plib, updated installer, fixed warnings

This commit is contained in:
Chris Danford
2003-01-08 04:16:39 +00:00
parent 5462cb2f6e
commit 7d1c2ea22e
10 changed files with 87 additions and 38 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
break;
default:
ASSERT( false ); // invalid type
ASSERT( 0 ); // invalid type
}
}
+20 -13
View File
@@ -536,12 +536,12 @@ void RageDisplay::EnterPerspective(float fov, bool preserve_loc)
/* Pull out the 2d rotations and scales. */
{
sgMat4 mat;
sgMakeIdentMat4(mat);
mat[0][0] = matTop.m[0][0];
mat[0][1] = matTop.m[0][1];
mat[1][0] = matTop.m[1][0];
mat[1][1] = matTop.m[1][1];
RageMatrix mat;
RageMatrixIdentity(&mat);
mat.m[0][0] = matTop.m[0][0];
mat.m[0][1] = matTop.m[0][1];
mat.m[1][0] = matTop.m[1][0];
mat.m[1][1] = matTop.m[1][1];
glMultMatrixf((float *) mat);
}
@@ -586,55 +586,62 @@ void RageDisplay::LookAt(const RageVector3 &Eye, const RageVector3 &At, const Ra
glGetFloatv( GL_MODELVIEW_MATRIX, (float*)view ); /* cheesy :) */
glPopMatrix();
sgPostMultMat4( GetTopModelMatrix().m, view.m );
RageMatrix& matTop = GetTopModelMatrix();
RageMatrixMultiply( &matTop, &view, &matTop );
}
void RageDisplay::Translate( float x, float y, float z )
{
RageMatrix matTemp;
RageMatrixTranslation( &matTemp, x, y, z );
RageMatrix& matTop = GetTopModelMatrix();
sgPreMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTemp, &matTop );
}
void RageDisplay::TranslateLocal( float x, float y, float z )
{
RageMatrix matTemp;
RageMatrixTranslation( &matTemp, x, y, z );
RageMatrix& matTop = GetTopModelMatrix();
sgPostMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTop, &matTemp );
}
void RageDisplay::Scale( float x, float y, float z )
{
RageMatrix matTemp;
RageMatrixScaling( &matTemp, x, y, z );
RageMatrix& matTop = GetTopModelMatrix();
sgPreMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTemp, &matTop );
}
void RageDisplay::RotateX( float r )
{
RageMatrix matTemp;
RageMatrixRotationX( &matTemp, r );
RageMatrix& matTop = GetTopModelMatrix();
sgPreMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTemp, &matTop );
}
void RageDisplay::RotateY( float r )
{
RageMatrix matTemp;
RageMatrixRotationY( &matTemp, r );
RageMatrix& matTop = GetTopModelMatrix();
sgPreMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTemp, &matTop );
}
void RageDisplay::RotateZ( float r )
{
RageMatrix matTemp;
RageMatrixRotationZ( &matTemp, r );
RageMatrix& matTop = GetTopModelMatrix();
sgPreMultMat4( matTop.m, matTemp.m );
RageMatrixMultiply( &matTop, &matTemp, &matTop );
}
void RageDisplay::SetTexture( RageTexture* pTexture )
+45 -12
View File
@@ -13,33 +13,66 @@
#include "RageMath.h"
#include "RageTypes.h"
#ifdef _DEBUG
#pragma comment(lib, "plib-1.6.0/sg_d.lib")
#pragma comment(lib, "plib-1.6.0/ul_d.lib")
#else
#pragma comment(lib, "plib-1.6.0/sg.lib")
#pragma comment(lib, "plib-1.6.0/ul.lib")
#endif
#include <math.h>
void RageVec2Normalize( RageVector2* pOut, const RageVector2* pV )
{
sgNormalizeVec2( (float*)pOut, (const float*)pV );
float scale = 1.0f / sqrtf( pV->x*pV->x + pV->y*pV->y );
pOut->x = pV->x * scale;
pOut->y = pV->y * scale;
}
void RageVec3TransformCoord( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM )
{
sgFullXformPnt3 ( (float*)pOut, (float*)pV, pM->m );
RageVector4 temp( pV->x, pV->y, pV->z, 1.0f );
RageVec4TransformCoord( &temp, &temp, pM );
*pOut = RageVector3( temp.x/temp.w, temp.y/temp.w, temp.z/temp.w );
}
void RageVec4TransformCoord( RageVector4* pOut, const RageVector4* pV, const RageMatrix* pM )
{
const RageMatrix &a = *pM;
const RageVector4 &v = *pOut;
*pOut = RageVector4(
a.m00*v.x+a.m10*v.y+a.m20*v.z+a.m30*v.w,
a.m01*v.x+a.m11*v.y+a.m21*v.z+a.m31*v.w,
a.m02*v.x+a.m12*v.y+a.m22*v.z+a.m32*v.w,
a.m03*v.x+a.m13*v.y+a.m23*v.z+a.m33*v.w );
}
void RageMatrixIdentity( RageMatrix* pOut )
{
sgMakeIdentMat4( pOut->m );
*pOut = RageMatrix(
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1 );
}
void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB )
{
sgMultMat4( pOut->m, pB->m, pA->m );
const RageMatrix &a = *pA;
const RageMatrix &b = *pB;
*pOut = RageMatrix(
a.m00*b.m00+a.m01*b.m10+a.m02*b.m20+a.m03*b.m30,
a.m00*b.m01+a.m01*b.m11+a.m02*b.m21+a.m03*b.m31,
a.m00*b.m02+a.m01*b.m12+a.m02*b.m22+a.m03*b.m32,
a.m00*b.m03+a.m01*b.m13+a.m02*b.m23+a.m03*b.m33,
a.m10*b.m00+a.m11*b.m10+a.m12*b.m20+a.m13*b.m30,
a.m10*b.m01+a.m11*b.m11+a.m12*b.m21+a.m13*b.m31,
a.m10*b.m02+a.m11*b.m12+a.m12*b.m22+a.m13*b.m32,
a.m10*b.m03+a.m11*b.m13+a.m12*b.m23+a.m13*b.m33,
a.m20*b.m00+a.m21*b.m10+a.m22*b.m20+a.m23*b.m30,
a.m20*b.m01+a.m21*b.m11+a.m22*b.m21+a.m23*b.m31,
a.m20*b.m02+a.m21*b.m12+a.m22*b.m22+a.m23*b.m32,
a.m20*b.m03+a.m21*b.m13+a.m22*b.m23+a.m23*b.m33,
a.m30*b.m00+a.m31*b.m10+a.m32*b.m20+a.m33*b.m30,
a.m30*b.m01+a.m31*b.m11+a.m32*b.m21+a.m33*b.m31,
a.m30*b.m02+a.m31*b.m12+a.m32*b.m22+a.m33*b.m32,
a.m30*b.m03+a.m31*b.m13+a.m32*b.m23+a.m33*b.m33
);
// phew!
}
void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z )
+3 -1
View File
@@ -13,12 +13,14 @@
struct RageVector2;
struct RageVector3;
struct RageVector4;
struct RageMatrix;
#include "plib-1.6.0/sg.h"
//#include "plib-1.6.0/sg.h"
void RageVec2Normalize( RageVector2* pOut, const RageVector2* pV );
void RageVec3TransformCoord( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM );
void RageVec4TransformCoord( RageVector4* pOut, const RageVector4* pV, const RageMatrix* pM );
void RageMatrixIdentity( RageMatrix* pOut );
void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB );
void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z );
+3 -3
View File
@@ -208,9 +208,9 @@ public:
float v30, float v31, float v32, float v33 )
{
m00=v00; m01=v01; m02=v02; m03=v03;
m10=v00; m11=v01; m12=v02; m13=v03;
m20=v00; m21=v01; m22=v02; m23=v03;
m30=v00; m31=v01; m32=v02; m33=v03;
m10=v10; m11=v11; m12=v12; m13=v13;
m20=v20; m21=v21; m22=v22; m23=v23;
m30=v30; m31=v31; m32=v32; m33=v33;
}
// access grants
+1 -1
View File
@@ -78,7 +78,7 @@ SOUNDMAN->music->StopPlaying();
//s[0].s.SetStartSeconds(45);
//s[0].s.SetPositionSeconds();
// s[4].s.SetLengthSeconds(1);
s[0].s.SetPlaybackRate(1.20);
s[0].s.SetPlaybackRate(1.20f);
//s[0].s.SetStopMode(RageSound::M_LOOP);
//s[0].s.Play();
+1 -1
View File
@@ -122,7 +122,7 @@ ScreenSelectMode::ScreenSelectMode()
this->AddChild( &m_Menu );
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_soundChange.Load( THEME->GetPathTo("Sounds","select style change"), 10 );
m_soundChange.Load( THEME->GetPathTo("Sounds","select style change"), true );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style intro") );
Binary file not shown.
Binary file not shown.
+13 -6
View File
@@ -7,8 +7,8 @@
; NOTE: this .NSI script is designed for NSIS v1.8+
Name "StepMania"
OutFile "stepmania300final.exe"
!define PRODUCT_NAME "StepMania 3.0 final"
OutFile "stepmania310.exe"
!define PRODUCT_NAME "StepMania 3.1"
; Some default compiler settings (uncomment and change at will):
@@ -81,7 +81,7 @@ WriteUninstaller "$INSTDIR\uninst.exe"
; add registry entries
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\StepMania\StepMania" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\StepMania" "DisplayName" "StepMania (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\StepMania" "DisplayName" "${PRODUCT_NAME} (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\StepMania" "UninstallString" '"$INSTDIR\uninst.exe"'
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\Applications\smpackage.exe\shell\open\command" "" '"$INSTDIR\smpackage.exe" "%1"'
@@ -145,7 +145,7 @@ File "Visualizations\instructions.txt"
SetOutPath "$INSTDIR"
; File "msvcr70.dll"
; File "msvcp70.dll"
File "bass.dll"
;File "bass.dll" ; Bass is no longer needed
File "jpeg.dll"
File "libpng13a.dll"
File "ogg.dll"
@@ -160,6 +160,9 @@ File "COPYING.txt"
File "README-FIRST.TXT"
File "NEWS"
File "stepmania.exe"
File "stepmania.vdi"
File "smpackage.exe"
; What to do here? Better to just delete an existing INI than to
; drop the local one in ... -glenn
; Agreed. - Chris
@@ -168,9 +171,13 @@ File "stepmania.exe"
; Maybe we should remove this for snapshot releases; that way we can
; track down problems with INI upgrades (and then possibly restore it
; for the release if we're not confident we've fixed most problems) -glenn
; Added message box to ask user. -Chris
IfFileExists "$INSTDIR\stepmania.ini" stepmania_ini_present stepmania_ini_not_present
stepmania_ini_present:
MessageBox MB_YESNO|MB_ICONQUESTION "Your settings from the previous installation of StepMania were found.$\nWould you like to keep these settings?" IDNO stepmania_ini_not_present
Delete "$INSTDIR\stepmania.ini"
File "stepmania.vdi"
File "smpackage.exe"
stepmania_ini_not_present:
; Create Start Menu icons
SetShellVarContext all ; install in "All Users" if NT