Skip to content

Commit

Permalink
new 3D fx
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyofr authored and yoyofr committed Apr 2, 2015
1 parent 5623fdb commit 519990d
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 6 deletions.
10 changes: 7 additions & 3 deletions modizer/Classes/DetailViewControllerIphone.mm
Expand Up @@ -102,7 +102,7 @@
static MPMediaItemArtwork *artwork;

static int txtMenuHandle[16];
static int txtSubMenuHandle[35];
static int txtSubMenuHandle[36];

//int texturePiano;

Expand Down Expand Up @@ -3883,6 +3883,7 @@ - (void)viewDidLoad {
txtSubMenuHandle[32]=0;
txtSubMenuHandle[33]=txtMenuHandle[11];
txtSubMenuHandle[34]=TextureUtils::Create([UIImage imageNamed:@"txtMenu12b_2x.png"]);
txtSubMenuHandle[35]=TextureUtils::Create([UIImage imageNamed:@"txtMenu12c_2x.png"]);

end_time=clock();
#ifdef LOAD_PROFILE
Expand Down Expand Up @@ -4444,7 +4445,7 @@ - (void)doFrame {
viewTapHelpShow=2;
viewTapHelpShowMode=2;
viewTapHelpShow_SubStart=32;
viewTapHelpShow_SubNb=3;
viewTapHelpShow_SubNb=4;
} else if (touched_coord==0x03) {
shouldhide=1;
} else if (touched_coord==0x23) {
Expand Down Expand Up @@ -4618,6 +4619,8 @@ - (void)doFrame {
case 27: //Piano
settings[GLOB_FXPiano].detail.mdz_switch.switch_value=3;
break;
case 32: //Spectrum3D
settings[GLOB_FX3DSpectrum].detail.mdz_switch.switch_value=3;
}
} else if (touched_coord==0x01) {
switch (viewTapHelpShow_SubStart) {
Expand Down Expand Up @@ -5166,7 +5169,8 @@ - (void)doFrame {
if (settings[GLOB_FX3].detail.mdz_switch.switch_value) mirror=0;
if (settings[GLOB_FX5].detail.mdz_switch.switch_value) mirror=0;
if (settings[GLOB_FXPiano].detail.mdz_switch.switch_value) mirror=0;
RenderUtils::DrawSpectrum3DBar(real_spectrumL,real_spectrumR,ww,hh,angle,settings[GLOB_FX3DSpectrum].detail.mdz_switch.switch_value,nb_spectrum_bands,mirror);
RenderUtils::DrawSpectrum3DBar(real_spectrumL,real_spectrumR,ww,hh,angle,
settings[GLOB_FX3DSpectrum].detail.mdz_switch.switch_value,nb_spectrum_bands,mirror);
}

if (settings[GLOB_FXPiano].detail.mdz_switch.switch_value) {
Expand Down
213 changes: 210 additions & 3 deletions modizer/MISC/RenderUtils.mm
Expand Up @@ -1110,15 +1110,19 @@
float _hh;// = _hw/aspectRatio;
//glFrustumf(-_hw, _hw, -_hh, _hh, 100.0f, 10000.0f);


switch (mode) {
case 1:
_hw = (float)nb_spectrum_bands*0.99/2;
_hh = _hw/aspectRatio;
break;
case 2:
_hw = 16*1.0/2;
_hh = _hw/aspectRatio;
break;
case 1:
case 3:
_hw = (float)nb_spectrum_bands*0.99/2;
_hh = _hw/aspectRatio;

break;
}

Expand Down Expand Up @@ -1149,6 +1153,27 @@
frameCpt++;

switch (mode) {
case 1:
glTranslatef(0.0, 0.0, -150.0+
15*(0.8f*sin((float)frameCpt*3.14159f/991)+
1.7f*sin((float)frameCpt*3.14159f/3065)-
0.3f*sin((float)frameCpt*3.14159f/5009)));

glRotatef(-90+10.0f*(0.8f*sin((float)frameCpt*3.14159f/2691)+
0.7f*sin((float)frameCpt*3.14159f/3113)-
0.3f*sin((float)frameCpt*3.14159f/7409)),0,0,1);


glRotatef(3*360.0f*(0.5f*sin((float)frameCpt*3.14159f/761)-
0.7f*sin((float)frameCpt*3.14159f/1211)-
0.9f*sin((float)frameCpt*3.14159f/2213)), 0, 1, 0);


glRotatef(10.0f*(0.8f*sin((float)frameCpt*3.14159f/891)-
0.2f*sin((float)frameCpt*3.14159f/211)-
0.4f*sin((float)frameCpt*3.14159f/5213)),0,0,1);

break;
case 2:
glTranslatef(0.0, 0.0, -190.0+
15*(0.8f*sin((float)frameCpt*3.14159f/991)+
Expand All @@ -1171,7 +1196,7 @@
0.9f*sin((float)frameCpt*3.14159f/2213)), 0, 1, 0);

break;
case 1:
case 3:
glTranslatef(0.0, 0.0, -150.0+
15*(0.8f*sin((float)frameCpt*3.14159f/991)+
1.7f*sin((float)frameCpt*3.14159f/3065)-
Expand Down Expand Up @@ -1588,6 +1613,188 @@
glRotatef(180-90, 0, 1, 0);
}
}
if (mode==3) {
float dsz;
#define absf(x) (x<0?x:-x)
for (int i=0; i<nb_spectrum_bands; i++) {
/////////////////
//LEFT
spL=barSpectrumDataL[i];

if (i<nb_spectrum_bands*2/3) {
cbt=(float)(nb_spectrum_bands*2/3-i)/(nb_spectrum_bands*2/3);
} else {
cbt=0;
}
if (i>nb_spectrum_bands/3) {
cgt=(float)(i-nb_spectrum_bands/3)/(nb_spectrum_bands*2/3);
} else {
cgt=0;
}
crt=1-fabs(i-nb_spectrum_bands/2)/(nb_spectrum_bands/2);
crt*=0.5+(spL/1);
if (crt>1) crt=1;
cgt*=0.5+(spL/1);
if (cgt>1) cgt=1;
cbt*=0.5+(spL/1);
if (cbt>1) cbt=1;

dsz=2+3*(0.2f*sin(frameCpt*0.05f+i*0.1f)+0.5f*sin(frameCpt*0.07f-i*0.3f+0.01f)*sin(frameCpt*0.07f-i*0.3f+0.01f)+0.5f*sin(frameCpt*0.01f+i*0.03f+0.2f)*sin(frameCpt*0.01f+i*0.03f+0.2f)*sin(frameCpt*0.01f+i*0.03f+0.2f));

sx=1;
sy=1;
sz=spL/2+0.1f;
x=-0.5f;
z=dsz+spL/4;
y=(i-nb_spectrum_bands/2)*sy*1.05f;

//glTranslatef(0,0,-8);
glRotatef(i*2*360/nb_spectrum_bands,0,1,0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);

glRotatef(90, 0, 1, 0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, -1, 0);

glRotatef(i*2*360/nb_spectrum_bands,0,-1,0);
//glTranslatef(0,0,8);

/////////////////
//RIGHT
spR=barSpectrumDataR[i];

if (i<nb_spectrum_bands*2/3) {
cbt=(float)(nb_spectrum_bands*2/3-i)/(nb_spectrum_bands*2/3);
} else {
cbt=0.1;
}
if (i>nb_spectrum_bands/3) {
cgt=(float)(i-nb_spectrum_bands/3)/(nb_spectrum_bands*2/3)+0.1;
} else {
cgt=0.1;
}
crt=1-fabs(i-nb_spectrum_bands/2)/(nb_spectrum_bands/2);
crt*=0.5+(spR/1);
if (crt>1) crt=1;
cgt*=0.5+(spR/1);
if (cgt>1) cgt=1;
cbt*=0.5+(spR/1);
if (cbt>1) cbt=1;


sx=1;
sy=1;
sz=spR/2+0.1f;
x=-0.5f;
z=dsz+spR/4;
y=(i-nb_spectrum_bands/2)*sy*1.05f;

glRotatef(180+i*2*360/nb_spectrum_bands,0,1,0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, 1, 0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, -1, 0);
glRotatef(180+i*2*360/nb_spectrum_bands,0,-1,0);

}

glRotatef(-3*360.0f*(0.5f*sin((float)frameCpt*3.14159f/761)-
0.7f*sin((float)frameCpt*3.14159f/1211)-
0.9f*sin((float)frameCpt*3.14159f/2213)), 0, 1, 0);

//glRotatef(180,0,0,1);
glTranslatef(12,0,0);

glRotatef(-3*360.0f*(0.5f*sin((float)frameCpt*3.14159f/761)-
0.7f*sin((float)frameCpt*3.14159f/1211)-
0.9f*sin((float)frameCpt*3.14159f/2213)), 0, 1, 0);

ang=0;
if (mirror)
for (int i=0; i<nb_spectrum_bands; i++) {
/////////////////
//LEFT
spL=barSpectrumDataL[i];

if (i<nb_spectrum_bands*2/3) {
cbt=(float)(nb_spectrum_bands*2/3-i)/(nb_spectrum_bands*2/3);
} else {
cbt=0;
}
if (i>nb_spectrum_bands/3) {
cgt=(float)(i-nb_spectrum_bands/3)/(nb_spectrum_bands*2/3);
} else {
cgt=0;
}
crt=1-fabs(i-nb_spectrum_bands/2)/(nb_spectrum_bands/2);
crt*=0.5+(spL/1);
if (crt>1) crt=1;
cgt*=0.5+(spL/1);
if (cgt>1) cgt=1;
cbt*=0.5+(spL/1);
if (cbt>1) cbt=1;

crt*=0.5;cgt*=0.5;cbt*=0.5;

dsz=2+3*(0.2f*sin(frameCpt*0.05f+i*0.1f)+0.5f*sin(frameCpt*0.07f-i*0.3f+0.01f)*sin(frameCpt*0.07f-i*0.3f+0.01f)+0.5f*sin(frameCpt*0.01f+i*0.03f+0.2f)*sin(frameCpt*0.01f+i*0.03f+0.2f)*sin(frameCpt*0.01f+i*0.03f+0.2f));

sx=1;
sy=1;
sz=spL/2+0.1f;
x=-0.5f;
z=dsz+spL/4;
y=(i-nb_spectrum_bands/2)*sy*1.05f;

glRotatef(i*2*360/nb_spectrum_bands,0,1,0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, 1, 0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, -1, 0);
glRotatef(i*2*360/nb_spectrum_bands,0,-1,0);


/////////////////
//RIGHT
spR=barSpectrumDataR[i];

if (i<nb_spectrum_bands*2/3) {
cbt=(float)(nb_spectrum_bands*2/3-i)/(nb_spectrum_bands*2/3);
} else {
cbt=0.1;
}
if (i>nb_spectrum_bands/3) {
cgt=(float)(i-nb_spectrum_bands/3)/(nb_spectrum_bands*2/3)+0.1;
} else {
cgt=0.1;
}
crt=1-fabs(i-nb_spectrum_bands/2)/(nb_spectrum_bands/2);
crt*=0.5+(spR/1);
if (crt>1) crt=1;
cgt*=0.5+(spR/1);
if (cgt>1) cgt=1;
cbt*=0.5+(spR/1);
if (cbt>1) cbt=1;

crt*=0.5;cgt*=0.5;cbt*=0.5;

sx=1;
sy=1;
sz=spR/2+0.1f;
x=-0.5f;
z=dsz+spR/4;
y=(i-nb_spectrum_bands/2)*sy*1.05f;

glRotatef(180+i*2*360/nb_spectrum_bands,0,1,0);

drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);

glRotatef(90, 0, 1, 0);
drawbar(x,y,z,sx,sy,sz,crt,cgt,cbt);
glRotatef(90, 0, -1, 0);

glRotatef(180+i*2*360/nb_spectrum_bands,0,-1,0);
}
}


/* Disable Vertex Pointer */
Expand Down
Binary file added modizer/Resources/Images/txtMenu12c.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modizer/Resources/Images/txtMenu12c_2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions modizer/modizer.xcodeproj/project.pbxproj
Expand Up @@ -703,6 +703,8 @@
CC33B4271ABE1FC6009608E8 /* slider.png in Resources */ = {isa = PBXBuildFile; fileRef = CC33B4261ABE1FC6009608E8 /* slider.png */; };
CC33B42D1ABF05A3009608E8 /* slider@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CC33B42C1ABF05A3009608E8 /* slider@2x.png */; };
CC4D69B312472B5C0074E94B /* info@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4D69B212472B5C0074E94B /* info@2x.png */; };
CC5B03F91ACC9CCA0015A136 /* txtMenu12c_2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5B03F71ACC9CCA0015A136 /* txtMenu12c_2x.png */; };
CC5B03FA1ACC9CCA0015A136 /* txtMenu12c.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5B03F81ACC9CCA0015A136 /* txtMenu12c.png */; };
CC5C709717CC8EB000DC7197 /* txtMenu11c.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5C709517CC8EB000DC7197 /* txtMenu11c.png */; };
CC5C709817CC8EB000DC7197 /* txtMenu11d.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5C709617CC8EB000DC7197 /* txtMenu11d.png */; };
CC5C709B17CD1BAE00DC7197 /* FFTAccelerate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CC5C709917CD1BAE00DC7197 /* FFTAccelerate.cpp */; };
Expand Down Expand Up @@ -2467,6 +2469,8 @@
CC4D69B212472B5C0074E94B /* info@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info@2x.png"; sourceTree = "<group>"; };
CC59B9061AC4B882004FEEBA /* libFileExtractor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libFileExtractor.xcodeproj; path = ../File_Extractor/libFileExtractor/libFileExtractor.xcodeproj; sourceTree = "<group>"; };
CC59B90C1AC4B91E004FEEBA /* fex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fex.h; path = ../File_Extractor/fex/fex.h; sourceTree = "<group>"; };
CC5B03F71ACC9CCA0015A136 /* txtMenu12c_2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = txtMenu12c_2x.png; sourceTree = "<group>"; };
CC5B03F81ACC9CCA0015A136 /* txtMenu12c.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = txtMenu12c.png; sourceTree = "<group>"; };
CC5C709517CC8EB000DC7197 /* txtMenu11c.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = txtMenu11c.png; sourceTree = "<group>"; };
CC5C709617CC8EB000DC7197 /* txtMenu11d.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = txtMenu11d.png; sourceTree = "<group>"; };
CC5C709917CD1BAE00DC7197 /* FFTAccelerate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FFTAccelerate.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4195,6 +4199,8 @@
33ABE59317B0E87D00AE0EA1 /* bb_caret-right@2x.png */,
33ABE58617B0E65400AE0EA1 /* bb_list.png */,
CC928DE717D0037B0098696C /* txtMenu12a.png */,
CC5B03F71ACC9CCA0015A136 /* txtMenu12c_2x.png */,
CC5B03F81ACC9CCA0015A136 /* txtMenu12c.png */,
CC928DE817D0037B0098696C /* txtMenu12b.png */,
33ABE58717B0E65400AE0EA1 /* bb_list@2x.png */,
33ABE58817B0E65500AE0EA1 /* bb_music.png */,
Expand Down Expand Up @@ -5861,6 +5867,7 @@
CC1E6371120423DF000A8A4E /* MusicMaker-8V in Resources */,
CC1E6372120423DF000A8A4E /* NovoTradePacker in Resources */,
CC1E6373120423DF000A8A4E /* NTSP-system in Resources */,
CC5B03FA1ACC9CCA0015A136 /* txtMenu12c.png in Resources */,
CC1E6374120423DF000A8A4E /* Octa-MED in Resources */,
CC1E6375120423DF000A8A4E /* Oktalyzer in Resources */,
CC1E6376120423DF000A8A4E /* onEscapee in Resources */,
Expand Down Expand Up @@ -5950,6 +5957,7 @@
CC03F2CE12160E9500F2AC65 /* button.png in Resources */,
CC03F2DB12160FE000F2AC65 /* buttonB-highlight.png in Resources */,
CC03F2DC12160FE000F2AC65 /* buttonB.png in Resources */,
CC5B03F91ACC9CCA0015A136 /* txtMenu12c_2x.png in Resources */,
CC03F2DD12160FE000F2AC65 /* buttonR-highlight.png in Resources */,
CC03F2DE12160FE000F2AC65 /* buttonR.png in Resources */,
CC03F2DF12160FE000F2AC65 /* buttonY-highlight.png in Resources */,
Expand Down

0 comments on commit 519990d

Please sign in to comment.