fna-workbench

fna-workbench Commit Details


Date:2016-01-27 11:43:50 (9 years 7 months ago)
Author:Ethan Lee
Branch:master
Commit:c83a9cccb7266399e322fbc505ebb3af2fc43a52
Parents: b4c138ff9f665b8590b747dd31e9aeef81c16e3d
Message:LogHookEXT

Changes:

File differences

src/FNAPlatform.cs
7070
7171
7272
73
74
75
76
77
7378
7479
7580
......
154159
155160
156161
157
158
162
159163
160164
161165
#region Public Static Methods
public static void UnhookLogger()
{
Log = SDL2_FNAPlatform.Log;
}
public delegate GameWindow CreateWindowFunc();
public static CreateWindowFunc CreateWindow;
public delegate bool IsStoragePathConnectedFunc(string path);
public static IsStoragePathConnectedFunc IsStoragePathConnected;
public delegate void LogFunc(string message);
public static LogFunc Log;
public static Action<string> Log;
public delegate void ShowRuntimeErrorFunc(string title, string message);
public static ShowRuntimeErrorFunc ShowRuntimeError;
src/Game.cs
12481248
12491249
12501250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
12511267
12521268
}
#endregion
#region FNA Extensions
public static void LogHookEXT(Action<string> logFunc)
{
if (logFunc == null)
{
FNAPlatform.UnhookLogger();
}
else
{
FNAPlatform.Log = logFunc;
}
}
#endregion
}
}
src/SDL2/SDL2_FNAPlatform.cs
151151
152152
153153
154
154
155155
156156
157157
......
432432
433433
434434
435
435
436436
437437
438438
......
457457
458458
459459
460
460
461461
462462
463463
464
464
465465
466466
467467
......
12221222
12231223
12241224
1225
1225
12261226
12271227
12281228
......
13771377
13781378
13791379
1380
1380
13811381
13821382
13831383
......
14051405
14061406
14071407
1408
1408
14091409
14101410
14111411
) == "1";
if (SDL2_KeyboardUtil.UseScancodes)
{
Log("Using scancodes instead of keycodes!");
FNAPlatform.Log("Using scancodes instead of keycodes!");
}
// Active Key List
}
catch(DllNotFoundException e)
{
Log("OpenAL not found! Need FNA.dll.config?");
FNAPlatform.Log("OpenAL not found! Need FNA.dll.config?");
throw e;
}
catch(Exception)
{
if (SDL.SDL_GL_SetSwapInterval(-1) != -1)
{
Log("Using EXT_swap_control_tear VSync!");
FNAPlatform.Log("Using EXT_swap_control_tear VSync!");
}
else
{
Log("EXT_swap_control_tear unsupported. Fall back to standard VSync.");
FNAPlatform.Log("EXT_swap_control_tear unsupported. Fall back to standard VSync.");
SDL.SDL_ClearError();
SDL.SDL_GL_SetSwapInterval(1);
}
INTERNAL_haptics[which] = SDL.SDL_HapticOpenFromJoystick(thisJoystick);
if (INTERNAL_haptics[which] == IntPtr.Zero)
{
Log("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());
FNAPlatform.Log("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());
}
}
if (INTERNAL_haptics[which] != IntPtr.Zero)
}
// Print controller information to stdout.
Log(
FNAPlatform.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();
Log("Removed device, player: " + output.ToString());
FNAPlatform.Log("Removed device, player: " + output.ToString());
}
// GetState can convert stick values to button values
src/SDL2/SDL2_KeyboardUtil.cs
432432
433433
434434
435
435
436436
437437
438438
......
449449
450450
451451
452
452
453453
454454
455455
return retVal;
}
}
SDL2_FNAPlatform.Log(
FNAPlatform.Log(
"KEY/SCANCODE MISSING FROM SDL2->XNA DICTIONARY: " +
key.sym.ToString() + " " +
key.scancode.ToString()
}
else
{
SDL2_FNAPlatform.Log("SCANCODE MISSING FROM XNA->SDL2 DICTIONARY: " + scancode.ToString());
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 0.70640s using 13 queries.