Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
14 user(s) are online (10 user(s) are browsing Forum)

Members: 0
Guests: 14

more...


Browsing this Thread:   1 Anonymous Users






Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#7
Home away from home
Home away from home


See User information
In the good ol'times maps were made of a grid of several indexed tiles; so instead of store the map as an unique image file you create a set of 16 pixels x 16 pixels or even 32 pixels x 32 pixels tiles that more or less repeats in the map, and you keep a reference index for every element of the grid, rebuilding it via software in the screen

Posted on: 2016/8/16 19:52
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#6
Home away from home
Home away from home


See User information
I got over my problem with image converters.

The Image Magick bundle came with some cli commands that could edit, change or convert graphic.


A simple command line like:

convert mapfull.png -depth 8 mapfull.rgb


Was all I need, the Image Magick Picture viewer has some interesting convert functions but *.rgb may have been a SGI format with run length compressions.


The convert command was able to do the conversion of the 32768x32768 image format ... but it needed some minutes for this huge file.


---

Maybe someone is asking what Map I wanted to convert, this was a Map from the Amiga game 'The Faery Tale Adventure' I just want to know how to handle such gigantic 2D Maps on a game.

I want to play around with its fine graphic maybe I will try and make some tribute RPG that acts as some kind of demo for this game.

Posted on: 2016/8/15 22:20
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#5
Home away from home
Home away from home


See User information
Thanks for your help, your answer made me look for the filesize.

---

I had a update, but it was worthless.

Explanation:

I have a MAP of the RPG/Adventure saved as PNG, I could open the PNG under Windows with Irfan View, but the file is extreme big. The image size is 32768x32768 Pixels this means it needs 4GB when loaded as RBGA.

The file I was working on, had only a quarter of this size (16384x16384) was exported as RAW (RBG/RGBA ?) via Irfan view. The file size was exactly 1GB (like I expected for RGBA) but it only consisted of values between 00 and 05 so it seems be faulty.

When using Image Magick (under Linux) my little system is crashing when I try to view the 1GPixel file, when exporting the smaller files as RGB, they only have a size of ~8MB, much less of the size I expected.

I never tried opening the Images under SDL, because I thought my tools for image export where OK, but they are not.

Posted on: 2016/8/15 9:10
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#4
Home away from home
Home away from home


See User information
Yes, that's probably what happened. I hope you have a backup Good luck with the rest of the program.

Posted on: 2016/8/14 15:29
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#3
Home away from home
Home away from home


See User information
Ooops sorry maybe it was a false alarm.

I chhecked the file with ls -la again, filesize is 0 ... maybe because I opened it accidently with 'w' first ...


Posted on: 2016/8/12 22:49
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#2
Home away from home
Home away from home


See User information
That's weird. It works for me on 64-bit Darwin with a 1.6GB file. Have you tried with other large files?

Posted on: 2016/8/12 20:52
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Slightly OT: Problem with GCC under Linux (Ubuntu 64Bit)
#1
Home away from home
Home away from home


See User information
I know this is not a Linux forum, but I have a problem with fread() on Linux AMD64 (Ubuntu).

If I am usingf fread() on a small file, it works like it should be. But currently I want to do some conversions on the Map of on old Amiga adventure.

This Map has a size of around 1GB of Data, I know it will be to big for the computers memory, therefore I'm reading small Blocks of Data with fread() but it doesn't work like it should be.

I know there can be some problems using fseek() on files > 4GB or there could be a problem with the filesystem but I don't understand the problems when using plain fread().

Code:
// compile with gcc myprog myprog.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

main(int argc,char *argv[])    
{
    
int rawsize = 64;
    
int readsize;
    
int i;
    
char* rawbytes;
    
FILE* rawfile;

    if ((
argc<1) && (strlen(argv[1])<2))
    {
        
printf("ERROR, Usage: %s filenamen", argv[0]);
        return(
1);
    }

    
// Open RGB.raw file
    
rawfile = fopen (argv[1],"rb");
    
    if (
rawfile == NULL)
    {
        
printf("%s ERROR: %s not foundn", argv[0], argv[1]);
        return (
1);
    }
    
    
rawbytes = malloc(rawsize);
    
    if (
rawbytes == NULL)
    {
        
printf("%s ERROR: Can not alloc %d Bytes for rawbytesn",argv[0], rawsize);
        return (
1);
    }
    
    
    for (
i=0; i<2048; i++)
    {
        
readsize = fread(rawbytes, 1, rawsize, rawfile);
        if (
rawsize == readsize)
        {
            
printf("PROCESSING: Block %dn", i);
        }
        else 
        {
            
printf("ERROR: Processing Block %d Size %d from %dn", i, readsize, rawsize);
            break;
        }
        
    }

    
    
// Close file
    
fclose (rawfile);
    
    
//Free the image
    
free(rawbytes);

}



When reading from a small file, it works without problems, when reading from a file with 1GB Filesize it doesn't read a single block of Data

results small file:
./fread fread.cPROCESSING: Block 0
PROCESSING
: Block 1
PROCESSING
: Block 2
PROCESSING
: Block 3
PROCESSING
: Block 4
PROCESSING
: Block 5
PROCESSING
: Block 6
PROCESSING
: Block 7
PROCESSING
: Block 8
PROCESSING
: Block 9
PROCESSING
: Block 10
PROCESSING
: Block 11
PROCESSING
: Block 12
PROCESSING
: Block 13
PROCESSING
: Block 14
ERROR
: Processing Block 15 Size 11 from 64


results big file:
./fread mapfull_RGB.raw
ERROR
: Processing Block 0 Size 0 from 64


Posted on: 2016/8/12 15:26
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project