GivePass / x360ce_latest

Automatically exported from code.google.com/p/x360ce
0 stars 0 forks source link

Incorrect config values trimming? #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think that method ReadStringFromFile() incorrectly trims comments starting 
with blank space - it looses last value character, see patch below...

@@ -47,7 +47,7 @@

        pStr = wcschr(strOutput, L' ');
        if (pStr) {
-           *(--pStr)=L'\0';
+           *pStr=L'\0';
            strOutput = pStr;
        }
        return ret;

Original issue reported on code.google.com by buryak.a...@gmail.com on 25 Aug 2011 at 10:00

GoogleCodeExporter commented 9 years ago
Seems do you know C/C++ well. Do you want to contribute in this project ?
If you want, I give you SVN access.

Original comment by tapcio on 25 Aug 2011 at 11:19

GoogleCodeExporter commented 9 years ago
I would love to, but can we discuss this later?

Right now I'm a bit busy with making a x360ce modification that will allow to 
use it over network - connecting gamepads to the remote computer and sending 
their input over TCP to the machine that actually runs a game. It's helpful 
when you have a fast computer that is able to run games in one room and TV in 
another room - you can simply use netbook and Wifi connection to resolve 
troubles with long USB cables or weak wireless gamepad connection.

I've tried to do the same thing using usbip and other soft, but it was too slow 
or too buggy.

I'm planning to finish my modification on this week and publish it to google 
code. If you like it, we can get back to the idea or my contribution into the 
project. Of course I will not insist to include my modification into trunk, it 
can exist as separate branch since I don't expect much people to use it :)

Original comment by buryak.a...@gmail.com on 25 Aug 2011 at 11:30

GoogleCodeExporter commented 9 years ago
It should be now fixed (in r440). I rewritten ini reading to minIni (first 
modified it - fixed incorrect UNICODE handling).
minIni is small and and suit x360ce needs, also supports easy key enumeration 
so it be easier for me to rewrite horrible configuration reading and gamepad 
mappings.
Also minIni support '#' style comments, even at end of the line! WINAPI 
supports only ';' comments at start of line.

Original comment by tapcio on 25 Aug 2011 at 8:36

GoogleCodeExporter commented 9 years ago
GetPrivateProfileString was a compact, but limited solution, on the other hand, 
minIni looks very promising. Nice!

BTW, about unicode and INI file: is this ok that Ini class in x360ce 
configuration app uses cp1252 to decode values?

Original comment by buryak.a...@gmail.com on 25 Aug 2011 at 9:09

GoogleCodeExporter commented 9 years ago
x360ce app was written by Evaldas Jocys and is not updated frequently.

I thinking to add to DLL some configuration saving options. Frontend will call 
them to write/change/etc. ini file, also it will be more thread safe.

Original comment by tapcio on 25 Aug 2011 at 9:28

GoogleCodeExporter commented 9 years ago
Ehh, I did not really answer your question.
I prefer to use Unicode everywhere, so cp1252 is not correct.

Original comment by tapcio on 25 Aug 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Yeah, reuse of DLL INI functions will solve such problems.

Original comment by buryak.a...@gmail.com on 26 Aug 2011 at 6:45

GoogleCodeExporter commented 9 years ago
I've updated to get r440, but have a problem with building it in VS2010 - it 
reports "minini.c : fatal error C1853: 
'...\x360ce\x360ce\obj\Debug\xinput1_3.pch' precompiled header file is from a 
previous version of the compiler, or the precompiled header is C++ and you are 
using it from C (or vice versa)"

It looks like /TP (Compile as C++ Code) compiler option is missing, or minini.c 
could be renamed into minini.cpp. #include of precompiled header in the source 
file start is also required by the compiler. Otherwise, I couldn't make the 
project to build :(

Original comment by buryak.a...@gmail.com on 26 Aug 2011 at 7:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in r441.

Original comment by tapcio on 26 Aug 2011 at 9:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
That was quick, thanks!

Original comment by buryak.a...@gmail.com on 26 Aug 2011 at 9:53

GoogleCodeExporter commented 9 years ago
It was only few project options. Also added additional VC_EXTRALEAN definition 
to stdafx to strip more stuff from headers.

Original comment by tapcio on 26 Aug 2011 at 9:59

GoogleCodeExporter commented 9 years ago
Sorry, I'm always forgetting to upload a diff of "x360ce over network" 
solution. The patch can be found here: 
http://dl.dropbox.com/u/1353767/x360ce.network.patch
If you are interested in it, let me know, I can provide it in some other form 
and give all needed explanations.

Original comment by buryak.a...@gmail.com on 28 Sep 2011 at 9:19

GoogleCodeExporter commented 9 years ago

Original comment by danialho...@gmail.com on 16 Feb 2013 at 7:11