-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Instance drawing #14
Open
mbrachner
wants to merge
24
commits into
xpnteam:master
Choose a base branch
from
mbrachner:InstanceDrawing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
fefe3b0
Added necessary types for XPLMInstance and created XPlaneInstance. St…
eb051e1
Merge branch 'master' into InstanceDrawing
0eaf212
Add back XPInstance and the factory from the XPSceneryObject
2c8f513
Make InstanceDrawing working, including the test harness.
829c8aa
Merge branch 'upstream/master' into InstanceDrawing
aeb99ca
Clean up the GraphicsTestPlugin. Add xpnetcfg.json to .gitignore
6f905fb
Trying to figure out how to pass a reference to DrawInfos
b64b2d7
Fix the drawing an object at multiple locations
30df4cb
Rename and move some structures that directly map to the X-Plane API.
9cf6c1d
Improve documentatino for XPDrawInfo
c2fe9b2
Document XPProbeResult enum
6a80edd
Add documentation to XPDrawingPhase
410fcee
Cosmetic change
becea96
Remove unintended line break
dead143
Cleaned up opening brackets of some blocks according to coding standard
e03c9bb
Clean up opening brackets for functions according to coding standard
007afe0
- Add Instance API to the available APIs
ec81927
For instance creation, change IEnumerable<string> for datarefs to str…
4801011
Instantiate 10 instances of the same object instead of just one instance
784a86e
Add documentation to XPlaneInstance
dd1de73
Remove some unnecessary comments and do cosmetic changes
ee20683
Add documentation to XPlaneScenery
8e3107c
Merge remote-tracking branch 'upstream/master' into InstanceDrawing
fd7f955
Merge branch 'master' into InstanceDrawing
mbrachner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ PublishProfiles | |
plugin | ||
package | ||
.DS_Store | ||
*.user | ||
*.user | ||
/XPNetPluginTestHost/xpnetcfg.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace XPNet | ||
{ | ||
public interface IXPlaneInstance | ||
mbrachner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
void CreateInstance(); | ||
void DestroyInstance(); | ||
} | ||
|
||
internal class XPlaneInstance : IXPlaneInstance | ||
{ | ||
public void CreateInstance() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void DestroyInstance() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
public interface IXPInstance : IDisposable | ||
{ | ||
void SetPosition(XPDrawInfo xPLMDrawInfo_t, IEnumerable<float> v); | ||
} | ||
|
||
internal unsafe class XPInstance : IXPInstance | ||
{ | ||
readonly void* m_instanceRef; | ||
mbrachner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public XPInstance(void* instanceRef) | ||
{ | ||
m_instanceRef = instanceRef; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
PluginBridge.ApiFunctions.XPLMDestroyInstance(m_instanceRef); | ||
} | ||
|
||
public void SetPosition(XPDrawInfo xPLMDrawInfo_t, IEnumerable<float> v) | ||
{ | ||
var floatArray = v.ToArray(); | ||
fixed (float* p = &floatArray[0]) | ||
{ | ||
PluginBridge.ApiFunctions.XPLMInstanceSetPosition(m_instanceRef, xPLMDrawInfo_t, p); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer to have the test harness just store and provide data, without logging to the console. The data can then be verified/asserted/logged either over in the test plugin (C#) or in XPNetPluginTestHost.cpp. If you didn't notice, there were no log messages here in the harness prior to your push last month. One of the directions I want to move with XPNet is to turn the test host into an actual automated unit test suite, which would mean that the places where it currently says, "look for log message XYZ to see if the test succeeded" would turn into tests that are checked for pass/fail. In preparation for that, all of the test output was isolated to XPNetPluginTestHost.cpp, and the harness here just tried/tries to be a simple stand-in for X-Plane. It's OK to do testing by checking logging output currently (that's how the other tests work now as well), but the logging and checking should be done in the test plugin or the test host, not the test harness, to reduce the amount of rework we'll have to do to make those tests automated. (If you're not sure how to do what I'm talking about, or are unfamiliar with automated unit testing, let me know and we'll discuss).