fna-workbench

fna-workbench Commit Details


Date:2016-01-16 10:27:24 (9 years 7 months ago)
Author:Ethan Lee
Branch:master
Commit:cf472f4586b996becd5f347daadf4f186eeca51d
Parents: 8207562a74cdca45138ff8a8810611ed100bd808
Message:printf/Exception cleanup

Changes:

File differences

src/Audio/AudioDevice.cs
5858
5959
6060
61
61
6262
6363
6464
// We should only have one of these!
if (ALDevice != null)
{
System.Console.WriteLine("ALDevice already exists, overwriting!");
FNAPlatform.Log("ALDevice already exists, overwriting!");
}
bool disableSound = Environment.GetEnvironmentVariable(
src/Audio/Cue.cs
306306
307307
308308
309
309
310310
311311
312312
......
338338
339339
340340
341
341
342342
343343
344344
......
414414
415415
416416
417
417
418418
419419
420420
......
483483
484484
485485
486
486
487487
488488
489489
......
699699
700700
701701
702
702
703703
704704
705705
return curVar.GetValue();
}
}
throw new Exception("Instance variable not found!");
throw new ArgumentException("Instance variable not found!");
}
public void Pause()
}
else if (INTERNAL_data.MaxCueBehavior == MaxInstanceBehavior.Queue)
{
throw new Exception("Cue Queueing not handled!");
throw new NotImplementedException("Cue Queueing not handled!");
}
else if (INTERNAL_data.MaxCueBehavior == MaxInstanceBehavior.ReplaceOldest)
{
return;
}
}
throw new Exception("Instance variable not found!");
throw new ArgumentException("Instance variable not found!");
}
public void Stop(AudioStopOptions options)
}
else
{
throw new Exception("Unhandled XACTEvent type!");
throw new NotImplementedException("Unhandled XACTEvent type!");
}
INTERNAL_eventPlayed[i] = true;
}
}
else
{
throw new Exception("RPC Parameter Type: " + curRPC.Parameter.ToString());
throw new NotImplementedException("RPC Parameter Type: " + curRPC.Parameter.ToString());
}
}
}
src/Audio/CueData.cs
718718
719719
720720
721
721
722722
723723
724724
......
931931
932932
933933
934
934
935935
936936
937937
* Type 9 - Marker Event
* -flibit
*/
throw new Exception(
throw new NotImplementedException(
"EVENT TYPE " + eventType.ToString() + " NOT IMPLEMENTED!"
);
}
}
else
{
throw new Exception(
throw new NotImplementedException(
"Variation Playlist Type unhandled: " +
INTERNAL_variationType.ToString()
);
src/Audio/DynamicSoundEffectInstance.cs
226226
227227
228228
229
229
230230
231231
232232
INTERNAL_alSource = AudioDevice.ALDevice.GenSource();
if (INTERNAL_alSource == null)
{
System.Console.WriteLine("WARNING: AL SOURCE WAS NOT AVAILABLE. SKIPPING.");
FNAPlatform.Log("WARNING: AL SOURCE WAS NOT AVAILABLE. SKIPPING.");
return;
}
src/Audio/OpenALDevice.cs
132132
133133
134134
135
135
136136
137137
138138
......
140140
141141
142142
143
143
144144
145145
146146
147147
148148
149149
150
150
151151
152152
153153
......
526526
527527
528528
529
529
530530
531531
532532
......
629629
630630
631631
632
632
633633
634634
635635
......
11081108
11091109
11101110
1111
1111
11121112
11131113
11141114
......
11231123
11241124
11251125
1126
1126
11271127
11281128
11291129
alDevice = ALC10.alcOpenDevice(envDevice);
if (CheckALCError() || alDevice == IntPtr.Zero)
{
throw new Exception("Could not open audio device!");
throw new InvalidOperationException("Could not open audio device!");
}
int[] attribute = new int[0];
if (CheckALCError() || alContext == IntPtr.Zero)
{
Dispose();
throw new Exception("Could not create OpenAL context");
throw new InvalidOperationException("Could not create OpenAL context");
}
ALC10.alcMakeContextCurrent(alContext);
if (CheckALCError())
{
Dispose();
throw new Exception("Could not make OpenAL context current");
throw new InvalidOperationException("Could not make OpenAL context current");
}
float[] ori = new float[]
*/
if (clamp && (pitch < -1.0f || pitch > 1.0f))
{
throw new Exception("XNA PITCH MUST BE WITHIN [-1.0f, 1.0f]!");
throw new IndexOutOfRangeException("XNA PITCH MUST BE WITHIN [-1.0f, 1.0f]!");
}
AL10.alSourcef(
(source as OpenALSource).Handle,
{
if (bufs[i] != (sync[i] as OpenALBuffer).Handle)
{
throw new Exception("Buffer desync!");
throw new InvalidOperationException("Buffer desync!");
}
}
#endif
return;
}
System.Console.WriteLine("OpenAL Error: {0:X}", err);
FNAPlatform.Log("OpenAL Error: " + err.ToString("X4"));
#if VERBOSE_AL_DEBUGGING
throw new InvalidOperationException("OpenAL Error!");
#endif
return false;
}
System.Console.WriteLine("OpenAL Device Error: {0:X}", err);
FNAPlatform.Log("OpenAL Device Error: " + err.ToString("X4"));
return true;
}
src/Audio/SoundEffectInstance.cs
264264
265265
266266
267
267
268268
269269
270270
);
if (INTERNAL_alSource == null)
{
System.Console.WriteLine("WARNING: AL SOURCE WAS NOT AVAILABLE. SKIPPING.");
FNAPlatform.Log("WARNING: AL SOURCE WAS NOT AVAILABLE. SKIPPING.");
return;
}
src/Audio/XACTInternal.cs
459459
460460
461461
462
462
463463
464464
465465
}
else
{
throw new Exception("DSP parameter unhandled: " + index.ToString());
throw new NotImplementedException("DSP parameter unhandled: " + index.ToString());
}
}
}
src/Graphics/Effect/Effect.cs
671671
672672
673673
674
674
675675
676676
677677
......
886886
887887
888888
889
889
890890
891891
892892
}
else
{
throw new Exception("Unhandled render state!");
throw new NotImplementedException("Unhandled render state!");
}
}
if (blendStateChanged)
}
else
{
throw new Exception("Unhandled sampler state!");
throw new NotImplementedException("Unhandled sampler state!");
}
}
if (filterChanged)
src/Graphics/GraphicsDevice.cs
424424
425425
426426
427
427
428428
429429
430430
431431
432
432
433433
434434
435435
wiiuStream = DRC.drc_new_streamer();
if (wiiuStream == IntPtr.Zero)
{
System.Console.WriteLine("Failed to alloc GamePad stream!");
FNAPlatform.Log("Failed to alloc GamePad stream!");
return;
}
if (DRC.drc_start_streamer(wiiuStream) < 1) // ???
{
System.Console.WriteLine("Failed to start GamePad stream!");
FNAPlatform.Log("Failed to start GamePad stream!");
DRC.drc_delete_streamer(wiiuStream);
wiiuStream = IntPtr.Zero;
return;
src/Graphics/OpenGLDevice.cs
635635
636636
637637
638
639
640
641
638
639
640
641
642642
643643
644644
......
17881788
17891789
17901790
1791
1791
1792
1793
17921794
17931795
17941796
......
18261828
18271829
18281830
1829
1831
1832
1833
18301834
18311835
18321836
MojoShader.MOJOSHADER_glMakeContextCurrent(shaderContext);
// Print GL information
System.Console.WriteLine("OpenGL Device: " + glGetString(GLenum.GL_RENDERER));
System.Console.WriteLine("OpenGL Driver: " + glGetString(GLenum.GL_VERSION));
System.Console.WriteLine("OpenGL Vendor: " + glGetString(GLenum.GL_VENDOR));
System.Console.WriteLine("MojoShader Profile: " + shaderProfile);
FNAPlatform.Log("OpenGL Device: " + glGetString(GLenum.GL_RENDERER));
FNAPlatform.Log("OpenGL Driver: " + glGetString(GLenum.GL_VERSION));
FNAPlatform.Log("OpenGL Vendor: " + glGetString(GLenum.GL_VENDOR));
FNAPlatform.Log("MojoShader Profile: " + shaderProfile);
// Load the extension list, initialize extension-dependent components
string extensions;
glEffect = MojoShader.MOJOSHADER_glCompileEffect(effect);
if (glEffect == IntPtr.Zero)
{
throw new Exception(MojoShader.MOJOSHADER_glGetError());
throw new InvalidOperationException(
MojoShader.MOJOSHADER_glGetError()
);
}
#if !DISABLE_THREADING
glEffect = MojoShader.MOJOSHADER_glCompileEffect(effect);
if (glEffect == IntPtr.Zero)
{
throw new Exception(MojoShader.MOJOSHADER_glGetError());
throw new InvalidOperationException(
MojoShader.MOJOSHADER_glGetError()
);
}
#if !DISABLE_THREADING
src/Graphics/OpenGLDevice_GL.cs
822822
823823
824824
825
825
826826
827827
828828
......
831831
832832
833833
834
834
835835
836836
837837
......
12131213
12141214
12151215
1216
1216
12171217
12181218
12191219
......
13661366
13671367
13681368
1369
1369
13701370
13711371
13721372
......
14091409
14101410
14111411
1412
1412
14131413
14141414
14151415
IntPtr message, // const GLchar*
IntPtr userParam // const GLvoid*
) {
System.Console.WriteLine(
FNAPlatform.Log(
"{0}\n\tSource: {1}\n\tType: {2}\n\tSeverity: {3}",
Marshal.PtrToStringAnsi(message),
source.ToString(),
);
if (type == GLenum.GL_DEBUG_TYPE_ERROR_ARB)
{
throw new Exception("ARB_debug_output found an error.");
throw new InvalidOperationException("ARB_debug_output found an error.");
}
}
{
if (useES2)
{
System.Console.WriteLine("Some non-ES functions failed to load. Beware...");
FNAPlatform.Log("Some non-ES functions failed to load. Beware...");
}
else
{
IntPtr messageControl = SDL.SDL_GL_GetProcAddress("glDebugMessageControlARB");
if (messageCallback == IntPtr.Zero || messageControl == IntPtr.Zero)
{
System.Console.WriteLine("ARB_debug_output not supported!");
FNAPlatform.Log("ARB_debug_output not supported!");
}
else
{
IntPtr stringMarkerCallback = SDL.SDL_GL_GetProcAddress("glStringMarkerGREMEDY");
if (stringMarkerCallback == IntPtr.Zero)
{
System.Console.WriteLine("GREMEDY_string_marker not supported!");
FNAPlatform.Log("GREMEDY_string_marker not supported!");
}
else
{
src/Graphics/Vertices/VertexDeclaration.cs
9595
9696
9797
98
98
9999
100100
101101
VertexDeclaration vertexDeclaration = type.VertexDeclaration;
if (vertexDeclaration == null)
{
throw new Exception("VertexDeclaration cannot be null");
throw new ArgumentException("vertexType's VertexDeclaration cannot be null");
}
return vertexDeclaration;
src/Media/Xiph/Song.cs
207207
208208
209209
210
210
211211
212212
213213
*/
if (Math.Abs(Duration.Milliseconds - durationMS) > 1000)
{
throw new Exception("XNB/OGG duration mismatch!");
throw new InvalidOperationException("XNB/OGG duration mismatch!");
}
}
src/Media/Xiph/Video.cs
117117
118118
119119
120
120
121121
122122
123123
124
124
125125
126126
127127
*/
if (width != Width || height != Height)
{
throw new Exception("XNB/OGV width/height mismatch!");
throw new InvalidOperationException("XNB/OGV width/height mismatch!");
}
if (Math.Abs(FramesPerSecond - framesPerSecond) >= 1.0f)
{
throw new Exception("XNB/OGV framesPerSecond mismatch!");
throw new InvalidOperationException("XNB/OGV framesPerSecond mismatch!");
}
// FIXME: Oh, hey! I wish we had this info in TheoraPlay!
src/Media/Xiph/VideoPlayer.cs
638638
639639
640640
641
641
642642
643643
644644
645645
646646
647
647
648648
649649
650650
......
661661
662662
663663
664
664
665665
666666
667667
......
676676
677677
678678
679
679
680680
681681
682682
}
// Initialize the thread!
System.Console.Write("Starting Theora player...");
FNAPlatform.Log("Starting Theora player...");
timer.Start();
if (audioStream != null)
{
audioStream.Play();
}
System.Console.WriteLine(" Done!");
FNAPlatform.Log("Started!");
}
public void Stop()
State = MediaState.Stopped;
// Wait for the player to end if it's still going.
System.Console.Write("Signaled Theora player to stop, waiting...");
FNAPlatform.Log("Signaled Theora player to stop, waiting...");
timer.Stop();
timer.Reset();
if (audioStream != null)
}
Video.AttachedToPlayer = false;
Video.Dispose();
System.Console.WriteLine(" Done!");
FNAPlatform.Log("Stopped!");
}
public void Pause()
src/SDL2/SDL2_FNAPlatform.cs
451451
452452
453453
454
454
455455
456456
457457
......
476476
477477
478478
479
479
480480
481481
482482
483
483
484484
485485
486486
......
496496
497497
498498
499
499
500500
501501
502502
......
12511251
12521252
12531253
1254
1254
12551255
12561256
12571257
......
14061406
14071407
14081408
1409
1409
14101410
14111411
14121412
......
14341434
14351435
14361436
1437
1437
14381438
14391439
14401440
}
catch(DllNotFoundException e)
{
System.Console.WriteLine("OpenAL not found! Need FNA.dll.config?");
Log("OpenAL not found! Need FNA.dll.config?");
throw e;
}
catch(Exception)
{
if (SDL.SDL_GL_SetSwapInterval(-1) != -1)
{
System.Console.WriteLine("Using EXT_swap_control_tear VSync!");
Log("Using EXT_swap_control_tear VSync!");
}
else
{
System.Console.WriteLine("EXT_swap_control_tear unsupported. Fall back to standard VSync.");
Log("EXT_swap_control_tear unsupported. Fall back to standard VSync.");
SDL.SDL_ClearError();
SDL.SDL_GL_SetSwapInterval(1);
}
}
else
{
throw new Exception("Unrecognized PresentInterval!");
throw new NotSupportedException("Unrecognized PresentInterval!");
}
}
INTERNAL_haptics[which] = SDL.SDL_HapticOpenFromJoystick(thisJoystick);
if (INTERNAL_haptics[which] == IntPtr.Zero)
{
System.Console.WriteLine("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());
Log("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());
}
}
if (INTERNAL_haptics[which] != IntPtr.Zero)
}
// Print controller information to stdout.
System.Console.WriteLine(
Log(
"Controller " + which.ToString() + ": " +
SDL.SDL_GameControllerName(INTERNAL_devices[which])
);
// A lot of errors can happen here, but honestly, they can be ignored...
SDL.SDL_ClearError();
System.Console.WriteLine("Removed device, player: " + output.ToString());
Log("Removed device, player: " + output.ToString());
}
// GetState can convert stick values to button values
src/SDL2/SDL2_KeyboardUtil.cs
418418
419419
420420
421
421
422422
423423
424424
......
432432
433433
434434
435
435
436436
437437
438438
......
446446
447447
448448
449
449
450450
451451
452452
}
else
{
System.Console.WriteLine("KEY MISSING FROM SDL2->XNA DICTIONARY: " + key.ToString());
SDL2_FNAPlatform.Log("KEY MISSING FROM SDL2->XNA DICTIONARY: " + key.ToString());
return Keys.None;
}
}
}
else
{
System.Console.WriteLine("SCANCODE MISSING FROM SDL2->XNA DICTIONARY: " + key.ToString());
SDL2_FNAPlatform.Log("SCANCODE MISSING FROM SDL2->XNA DICTIONARY: " + key.ToString());
return Keys.None;
}
}
}
else
{
System.Console.WriteLine("SCANCODE MISSING FROM XNA->SDL2 DICTIONARY: " + scancode.ToString());
SDL2_FNAPlatform.Log("SCANCODE MISSING FROM XNA->SDL2 DICTIONARY: " + scancode.ToString());
return Keys.None;
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 1.25814s using 13 queries.