Browse Source

Code cleanup & license update for UWP

LouYihua 7 years ago
parent
commit
5cf476ce54

+ 29 - 7
winrt/SDLPal.Common/AsyncHelper.h

@@ -1,10 +1,32 @@
-/*
-*   AsyncHelper.h
-*
-*   Date: 1st July, 2014   Author: David Huang
-*   (C) 2014 Light Studio. All Rights Reserved.
-*   Modified by louyihua@2016
-*/
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
+//
+// AsyncHelper.h: UWP support library for SDLPal.
+//
+// Original author: David Huang @ 1st July, 2014
+//                  (C) 2014 Light Studio. All Rights Reserved.
+//
+// Modified by: Lou Yihua @ 2016
+//
+// Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// Copyright (c) 2011-2017 SDLPAL development team.
+// All rights reserved.
+//
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
 #pragma once
 #include <ppltasks.h>
 #include <Windows.h>

+ 25 - 0
winrt/SDLPal.Common/NativeBuffer.h

@@ -1,3 +1,28 @@
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
+//
+// NativeBuffer.h: UWP support library for SDLPal.
+// Author: Lou Yihua @ 2017
+//
+// Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// Copyright (c) 2011-2017 SDLPAL development team.
+// All rights reserved.
+//
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
 #pragma once
 
 #include <wrl.h>

+ 25 - 0
winrt/SDLPal.Common/StringHelper.h

@@ -1,3 +1,28 @@
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
+//
+// StringHelper.h: UWP support library for SDLPal.
+// Author: Lou Yihua @ 2016
+//
+// Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// Copyright (c) 2011-2017 SDLPAL development team.
+// All rights reserved.
+//
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
 #pragma once
 
 #include <wrl.h>

+ 25 - 0
winrt/SDLPal.Common/WinRTIO.cpp

@@ -1,3 +1,28 @@
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
+//
+// WinRTIO.cpp: UWP C-style file I/O wrapper for SDLPal.
+// Author: Lou Yihua @ 2016-2017
+//
+// Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// Copyright (c) 2011-2017 SDLPAL development team.
+// All rights reserved.
+//
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
 #include <wrl.h>
 #include <string>
 #include <DXGI.h>

+ 5 - 32
winrt/native_midi.cpp

@@ -1,5 +1,8 @@
 /* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
+// native_midi.cpp: Native UWP MIDI player for SDLPal.
+// Author: Lou Yihua @ 2017
+//
 // Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // Copyright (c) 2011-2017 SDLPAL development team.
 // All rights reserved.
@@ -32,8 +35,8 @@
 #include <atomic>
 
 extern "C" {
-#include "../../native_midi/native_midi.h"
-#include "../../native_midi/native_midi_common.h"
+#include "native_midi/native_midi.h"
+#include "native_midi/native_midi_common.h"
 }
 
 struct MidiEvent
@@ -202,24 +205,6 @@ static void MIDItoStream(NativeMidiSong *song, MIDIEvent *eventlist)
 	song->Position = 0;
 	song->Loaded = 1;
 }
-//
-//void CALLBACK MidiProc(HMIDIIN hMidi, UINT uMsg, unsigned long dwInstance,
-//	unsigned long dwParam1, unsigned long dwParam2)
-//{
-//	switch (uMsg)
-//	{
-//	case MOM_DONE:
-//		if ((currentsong->MusicLoaded) && (dwParam1 == (unsigned long)&currentsong->MidiStreamHdr))
-//			BlockOut(currentsong);
-//		break;
-//	case MOM_POSITIONCB:
-//		if ((currentsong->MusicLoaded) && (dwParam1 == (unsigned long)&currentsong->MidiStreamHdr))
-//			currentsong->MusicPlaying = 0;
-//		break;
-//	default:
-//		break;
-//	}
-//}
 
 int native_midi_detect()
 {
@@ -230,18 +215,6 @@ int native_midi_detect()
 		return 0;
 	}
 	return 1;
-
-	//auto devs = AWait(Windows::Devices::Enumeration::DeviceInformation::FindAllAsync(Windows::Devices::Enumeration::DeviceClass::AudioRender));
-	//for each(auto dev in devs)
-	//{
-	//	if (wcsstr(dev->Name->Data(), L"ASUS"))
-	//	{
-	//		Synthesizer = AWait(Windows::Devices::Midi::MidiSynthesizer::CreateAsync(dev));
-	//		std::unique_ptr<SDL_RWops> rw(SDL_RWFromConstMem(data, sizeof(data)));
-	//		native_midi_loadsong_RW(rw.get());
-	//	}
-	//}
-	//return Synthesizer ? 0 : 1;
 }
 
 NativeMidiSong *native_midi_loadsong(const char *midifile)