|
|
2006-05-13
, 11:09
|
|
Posts: 39 |
Thanked: 2 times |
Joined on Dec 2005
|
#62
|
This is the full .deb I modified.
Sorry for no upload before, I have no discovered that i can upload files til now.
I hope it be useful.
Cheers,
Demostenes
Edit: I don't know why is not possible to directly install .deb from the navigator (file type : unknown). Any ideas?. Try to save adding '.deb' to filename and install manually.
|
|
2006-05-13
, 13:09
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Apr 2006
|
#63
|
static gfloat strtofloat(gchar *num)
/* Function to convert string to float number
***Note I have no check for errors in string***
*/
{
gfloat ret = 0.f;
gchar *pchar;
gfloat n;
gfloat dec = 0.f;
pchar = num;
while(*pchar != '\0' && *pchar !=' ') {
if (*pchar == '.')
dec = 10.f;
else {
if (dec) {
n = ((gfloat) (*pchar - '0')) / dec;
dec *= 10.f;
}
else {
n = (gfloat) (*pchar - '0');
ret *= 10.f;
}
ret += n;
}
pchar++;
}
return(ret);
}
|
|
2006-05-13
, 15:44
|
|
Posts: 31 |
Thanked: 2 times |
Joined on Apr 2006
@ Vilnius, Lithuania
|
#64
|
|
|
2006-05-13
, 15:52
|
|
Posts: 31 |
Thanked: 2 times |
Joined on Apr 2006
@ Vilnius, Lithuania
|
#65
|
Even the topo maps would be pretty hard to integrate into Maemo Mapper now, as they are based on a completely different map identifier scheme (not X/Y; instead more quadtree-esque). Doable, but since I prefer the street data, I don't think I'll be tackling that problem at the moment.
|
|
2006-05-13
, 17:17
|
|
Posts: 31 |
Thanked: 2 times |
Joined on Apr 2006
@ Vilnius, Lithuania
|
#66
|
void convert(int x, int y, int zoomlevel, char * buffer)
{
char * quadrant = "qrts";
char * ptr = buffer;
int n;
*ptr++ = 't';
for (n = 16-zoomlevel; n >= 0; n--) {
int xbit = (x >> n) & 1;
int ybit = (y >> n) & 1;
*ptr++ = quadrant[xbit + 2 * ybit];
}
*ptr++ = '\0';
}
#include <stdio.h>
#include <string.h>
int test(int x, int y, int zoomlevel, char * expected)
{
char buffer[19];
convert(x, y, zoomlevel, buffer);
if (strcmp(buffer, expected) != 0) {
printf("failure with (%d, %d, %d): expected \"%s\", got \"%s\".\n",
x, y, zoomlevel, expected, buffer);
return 1;
}
return 0;
}
int main()
{
int failures = 0;
failures += test(0, 0, 17, "t");
failures += test(0, 0, 16, "tq");
failures += test(1, 0, 16, "tr");
failures += test(1, 1, 16, "ts");
failures += test(0, 1, 16, "tt");
failures += test(0, 0, 15, "tqq");
failures += test(1, 0, 15, "tqr");
failures += test(2, 0, 15, "trq");
failures += test(3, 0, 15, "trr");
failures += test(2335, 1295, 5, "trtqsqqqrssss");
if (!failures) {
printf("All tests passed.\n");
return 0;
} else {
return 1;
}
}
|
|
2006-05-13
, 17:27
|
|
Posts: 182 |
Thanked: 3 times |
Joined on Mar 2006
|
#67
|
|
|
2006-05-13
, 18:13
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Apr 2006
|
#68
|
Could it be that the atof function pays attention to the system locale, specifically, to the decimal separator? Demosthenes, if you open language/region in the control panel, what is the decimal separator set to?
)
.|
|
2006-05-13
, 19:46
|
|
Posts: 31 |
Thanked: 2 times |
Joined on Apr 2006
@ Vilnius, Lithuania
|
#69
|
Did I mention that I would be very happy to see Google satellite map support in MaemoMapper?
|
|
2006-05-13
, 19:48
|
|
Posts: 31 |
Thanked: 2 times |
Joined on Apr 2006
@ Vilnius, Lithuania
|
#70
|
Sorry for no upload before, I have no discovered that i can upload files til now
I hope it be useful.
Cheers,
Demostenes
Edit: I don't know why is not possible to directly install .deb from the navigator (file type : unknown). Any ideas?. Try to save adding '.deb' to filename and install manually.
Last edited by Demostenes; 2006-05-13 at 10:34.