Page 7 of 8 FirstFirst ... 4 5 6 7 8 LastLast
Results 181 to 210 of 234

Thread: Sprite Editor

  1. #181
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Ok I replaced all the pure black and it still crashes. I added back thedeleted frame and nothing. I then went backtothe original sprite fiile and only replaced the idle, death, and the east direction move. I did not delete or add any frames. it still crashed.

    I then went into the game and shut animations off. I found that it would still show the first frame of the east move when I moved. I have also placed my other sprite file (with all directions and added and deleted frames) and it works with animations OFF (still showing one frame of differet directions)

    so I'm thinking it might be a problem with the sequencing of multidimensional animations. but I thik it doesn't have to do with pure black, maybe the way its saving the sprite file?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  2. #182
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    e I think pure black is being created in tga import function of spriteedit.
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  3. #183
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    I suspect that Mc i sright with regard to the error having to do with the black pixels, so I'm working on a patch that will eliminate black pixels, by simply converting them to RGB 1,1,1 (or 8,8,8 in 24/32 bit)

    E, I found an error in the animation-sequence in your sprite, the sprite-frame-numbers used were from 1-10 while the available sprite-frame-numbers in the file is 0-9. (correcting this allowed me to move the sprite E and SE in game)
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  4. #184
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    Updated SpriteEdit:

    Changes from Build 11 to 12
    1. Modified the tga-import to eliminate "pure-black". Now if the tga contains pure black pixels those pixels will be converted to the darkest gray.
    2. Added 4 short-cut keys:
      In the Main window:
      1. <CTRL> + <SHIFT> + E = Edit currently selected sprite-frame
      2. <CTRL> + <SHIFT> + I = Insert a sprite-frame befor the currently selected sprite-frame
      3. <CTRL> + <SHIFT> + A = Add a sprite-frame to the current animation.
      In the Edit sprite-frame window:
      1. <ALT> + L = Open the load tga dialog.


    Please tell me witch short-cuts you miss the most, and if you have any suggestions as to whitch keys to use that would be welcome as well.

    E, I tried reimporting the south-facing move sprite-frames, to your version of GU002.spr this solved the problem, so now I had no crashes (played 5-6 turns, just moving my settler arround)
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  5. #185
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    Already download tell you how it goes tomorrow.
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  6. #186
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin did you update the link in your signature? It sill has a december 30th sprite-edit...
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  7. #187
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    Oops

    I did update the file in my sig, but forgot to update the file in the zip (Guess I should have satayed in bed.)
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  8. #188
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin, I'm still having a problem with my settler graphics. But since you said you re-imported them, then maybe there is something I did wrong with the TGAs. I'll test it out and get back on that.

    Another thing though. I tried to edit the battleship graphics by adding the civ3 battleship graphics. the civ3 frame size is bgger and when I hit edit, instead of sprite-edit placing the whole frame it just pasted over part of the original frame. This by design? Inserting a frame does the same thing? Is there a way to get a larger frame size? I thought I was able to do it in build 10 or 11. just checking...
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  9. #189
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    OK, I saved the images of the north move and re-entered them. (The export function I couldnt get to work). I then loaded the game and tried to move north and it crashed

    I then thought the "render" blocks not being checked were a problem (even though they were not for the idle graphics) I checked them and reloaded for the north again. And it still crashed.

    (still have solved the problem wuth the larger frames with the battleship either)

    Not sure what I'm doing wrong, but perhaps when BigMC checks in he can give some insight.

    here's my tgas in case I saved them in a bad format (but the load fine and are 24bit TGAs)
    Attached Files Attached Files
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  10. #190
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    With regard to changing the image-size it will be implemented, but rigth now you'll have to find a sprite with the right image-size and work from there. The problem is that each sprite can have only one image-size, so this will be implemented along with the ability to create sprites from scratch.

    As to your sprite. I copied it to my ctp-sprite folder and started the game, no problem, moved it around 10-15 turns and settled still no probelm. I havn't tried the death anim though.
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  11. #191
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin, are you running CTP2 on XP? the sprite works when animations are set to off, but when they are on, the game crashes.

    Can anyone else test out my sprite? Its in the zip above Martin's post.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  12. #192
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    Yes I am running CTP2 on XP.
    I just tested the death anim, and it crashes, no matter what I do, so I'll have to take a closer look at it.
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  13. #193
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    my death did not crash, it just shows nothing. still its the move that crashes it. weird.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  14. #194
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    I think I know why your death anim is crashing. For somereason it was able to load a different size frame forthe death anim. the other ones are 96x72. Death is 104x77.

    this might be why my move is a problem too, but I'm not sure.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  15. #195
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin,

    I think ithas to do with spriteframes as well. Can you give a run down as to what these fields should be? It appears that even when you open an existing sprite it still has to be fixed.

    one issue is that move, idle, victory on my sprite are in that order but it says sprite first frame is 20 for idle and 30 for death. Should it be 0?

    I did adjust it for move and my move finally started working, except it would crash every now and again, maybe it reset, not sure.
    Attached Images Attached Images
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  16. #196
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    resetting stuff to 0 seemed to work. I tried a few turns and it worked and made another, boat, sprite. but then I loaded a new sprite, it ran etc and I did it just like the other ones, then at the end of the turn the game crashed. Then reloading the game I didnt add any of the other ones and now the settler sprite crashes again. not sure whats going on.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  17. #197
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    As far as I hav been able to figure it out the fields are as follows:

    Sprite Num Frames = the number of actual images available for the selected animation.

    Sprite First Frame = this is the number of the first image imported when using makespr.exe (the Apolyton sprite generator) What it does in the game, or the sprite-file I don't know. Just keep it at 0 or 1 to be safe

    Anim Type = the way the animation is played in ctp. sequential plays through from the first frame to the last defined frame, looped starts over at the first frame when it's gone through all of the frames, back-n-forth reverses direction of playback when it reaches the last frame, and playes back to the first before reversing direction again.

    Anim Num Frames = the number of frames in the animation, these frames are realy just a list of numbers, refering to Sprite Frames.

    Anim Playback Time = the time to play the animation sequence, not used in Civ:CTP, not sure about CTP2

    Anim Delay = Amount of time to display the last frame before repeating, don't know how it is messured.

    If you have not done this yet, it is a good idea to read the first part of documentation that came with makespr.exe (I have attached it to this post)

    I have not had the time to look into why SpriteEdit allows import of wrong-sized images. I won't be home much over the next week or so, so I can't promise anything.
    Attached Files Attached Files
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  18. #198
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    Martin spritedit does not save the image size. on build 12. this means that the sprite may be displayed distorted or as e said not appear.
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  19. #199
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    I just checked, the size is saved to the sprite-file, but somehow I have managed to eliminate the check for image-size on import. (Probably happend when I rewrote the import routeens) I'll add a check in the next build, but when that will be I don't know.

    E, if you have the time, I would apreciate it if you could try using the same size for all images, and see if this solves the problem. This will help eleminate other causes for the problem.
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  20. #200
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    I will say something I think e image is innocent of the bug I replaced the north walk with a image I knew could not case a problem (a giant blue box) this also caused the game to crash . but I can’t shake the thought I had a similar problem with the active$ion sprite maker.
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  21. #201
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Yeah,
    I eventually went in and redid the sprites to keep them all the same size. I thought it worked, one game I did a few turns and everything was going great (for 3 sprites I made using sprite edit no less) then a crash happened and since then I'm back to square one, where a settler moving crashes it again. I'm loss at to what else to do now. I too shall take a break and maybe think of something I did wrong.

    thanks guys.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  22. #202
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin,

    I glanced through the source code would any of this help:

    Code:
    #include "c3.h"
    
    #include "pixelutils.h"
    #include "spriteutils.h"
    
    extern sint32 g_is565Format;
    
    void spriteutils_EncodeShadowRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	uint8			alpha;
    	sint32			runLen = 0;
    	Pixel16			footer=0;
    	Pixel16			shadowPixel;
    
    	if (g_is565Format) shadowPixel = k_SHADOW_PIXEL_565;
    	else shadowPixel = k_SHADOW_PIXEL_555;
    
    	RGB32Info(**inBuf, &pix16, &alpha);
    	while (pix16 == shadowPixel && (*pos < width)) {
    		
    		(*inBuf)++;
    
    		
    		(*pos)++;
    
    		
    		runLen++;
    
    		RGB32Info(**inBuf, &pix16, &alpha);
    	}
    
    	
    	footer = (Pixel16)(k_SHADOW_RUN_ID << 8 | runLen);
    
    	
    	if (*pos >= width) footer |= k_EOLN_ID << 8;
    	
    	
    	**outBufPtr = footer;
    	(*outBufPtr)++;
    }
    
    void spriteutils_EncodeCopyRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	uint8			alpha;
    	sint32			runLen = 0;
    	Pixel16			footer=0;
    	Pixel16			*headerPtr;
    	Pixel16			shadowPixel;
    
    	if (g_is565Format) {
    		shadowPixel = k_SHADOW_PIXEL_565;
    	} else { 
    		shadowPixel = k_SHADOW_PIXEL_555;
    	}
    
    	headerPtr = *outBufPtr;
    	(*outBufPtr)++;
    
    	RGB32Info(**inBuf, &pix16, &alpha);
    
    	while (pix16 != shadowPixel && alpha == k_ALL_ALPHA && (*pos < width)) {
    
    		
    		if (pix16 == 0x0000) pix16 = 0x0001;
    
    		
    		**outBufPtr = pix16;
    
    		
    		(*outBufPtr)++;
    		
    		
    		(*inBuf)++;
    
    		
    		(*pos)++;
    
    		
    		runLen++;
    
    		RGB32Info(**inBuf, &pix16, &alpha);
    	}
    	
    	
    	footer = (Pixel16) (k_COPY_RUN_ID << 8 | runLen);
    
    	
    	if (*pos >= width) footer |= k_EOLN_ID << 8;
    
    	*headerPtr = footer;
    }
    
    char spriteutils_EncodeChromakeyRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	uint8			alpha;
    	sint32			runLen = 0;
    	Pixel16			footer=0;
    
    	RGB32Info(**inBuf, &pix16, &alpha);
    	while (pix16 == k_CHROMAKEY_PIXEL && alpha == k_NO_ALPHA && (*pos < width)) {
    		
    		(*inBuf)++;
    
    		
    		(*pos)++;
    
    		
    		runLen++;
    
    		RGB32Info(**inBuf, &pix16, &alpha);
    	}
    
    	
    	if (runLen < width) {
    		
    		footer = (Pixel16)(k_CHROMAKEY_RUN_ID << 8 | runLen);
    
    		
    		if (*pos >= width) footer |= k_EOLN_ID << 8;
    		
    		
    		**outBufPtr = footer;
    		(*outBufPtr)++;
    	} else {
    		
    		return TRUE;
    	}
    
    	return FALSE;
    }
    
    char spriteutils_EncodeChromakeyWshadowRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	uint8			alpha;
    	sint32			runLen = 0;
    	Pixel16			footer=0;
    
    	RGB32Info(**inBuf, &pix16, &alpha);
    	while ( ((pix16 == k_CHROMAKEY_PIXEL && alpha == k_NO_ALPHA) ||  (pix16 == k_SHADOWBACKGD_PIXEL))  && (*pos < width) ) {
    		
    		(*inBuf)++;
    
    		
    		(*pos)++;
    
    		
    		runLen++;
    
    		RGB32Info(**inBuf, &pix16, &alpha);
    	}
    
    	
    	if (runLen < width) {
    		
    		footer = (Pixel16)(k_CHROMAKEY_RUN_ID << 8 | runLen);
    
    		
    		if (*pos >= width) footer |= k_EOLN_ID << 8;
    		
    		
    		**outBufPtr = footer;
    		(*outBufPtr)++;
    	} else {
    		
    		return TRUE;
    	}
    
    	return FALSE;
    }
    
    void spriteutils_EncodeFeatheredRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	Pixel16			footer=0;
    	uint8			alpha;
    
    	RGB32Info(**inBuf, &pix16, &alpha);
    
    	
    	if (pix16 == 0x0000) pix16 = 0x0001;
    
    	(*inBuf)++;
    	(*pos)++;
    
    	footer = (k_FEATHERED_RUN_ID << 8) | alpha;
    
    	
    	if (*pos >= width)
    		footer |= k_EOLN_ID << 8;
    
    	
    	**outBufPtr = footer;
    	(*outBufPtr)++;
    
    	
    	**outBufPtr = pix16;
    	(*outBufPtr)++;
    
    }
    
    
    char spriteutils_EncodeScanline(Pixel32 *scanline, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	Pixel32			pix32;
    	Pixel32			*scanPtr = scanline;
    	uint8			alpha;
    	sint32			pos;
    	Pixel16			*startPtr;
    	BOOL			empty;
    	Pixel16			shadowPixel;
    
    	if (g_is565Format) {
    		shadowPixel = k_SHADOW_PIXEL_565;
    	} else { 
    		shadowPixel = k_SHADOW_PIXEL_555;
    	}
    
    
    	pos = 0;
    
    	
    	startPtr = *outBufPtr;
    
    	
    
    	while (scanPtr < (scanline + width)) 
    	{
    		pix32 = *scanPtr;
    		
    		empty = FALSE;
    
    		RGB32Info(pix32, &pix16, &alpha);
    		
    		
    		
    		
    		
    		
    
    		if ((pix16 == k_CHROMAKEY_PIXEL)&&(alpha == k_NO_ALPHA)) 
    		
    		{
    
    			
    			empty = spriteutils_EncodeChromakeyRun(&scanPtr, &pos, width, outBufPtr);
    		}
    		else
    		if (pix16 == shadowPixel) 
    		{
    			
    			spriteutils_EncodeShadowRun(&scanPtr, &pos, width, outBufPtr);
    		}
    		else
    		if ((alpha!=k_NO_ALPHA) && (alpha!=k_ALL_ALPHA)) 
    		{
    			
    			spriteutils_EncodeFeatheredRun(&scanPtr, &pos, width, outBufPtr);			
    		}
    		else {
    			
    			if (alpha == k_ALL_ALPHA)
    				spriteutils_EncodeCopyRun(&scanPtr, &pos, width, outBufPtr);
    			else 
    			{
    
    			   	printf("\nError in bitmap data.  Pixel with no associated alpha.\n");
    			   
    			   	exit(-1);
    			}
    		}
    	}
    
    	return empty;
    }
    
    
    char spriteutils_EncodeScanlineWshadow(Pixel32 *scanline, sint32 width, Pixel16 **outBufPtr)
    {
    	Pixel16			pix16;
    	Pixel32			pix32;
    	Pixel32			*scanPtr = scanline;
    	uint8			alpha;
    	sint32			pos;
    	Pixel16			*startPtr;
    	BOOL			empty;
    	Pixel16			shadowPixel;
    
    	if (g_is565Format) {
    		shadowPixel = k_SHADOW_PIXEL_565;
    	} else { 
    		shadowPixel = k_SHADOW_PIXEL_555;
    	}
    
    
    	pos = 0;
    
    	
    	startPtr = *outBufPtr;
    
    	
    
    	while (scanPtr < (scanline + width)) {
    		pix32 = *scanPtr;
    		
    		empty = FALSE;
    
    		RGB32Info(pix32, &pix16, &alpha);
    
    		if ( (pix16 == k_CHROMAKEY_PIXEL  && alpha == k_NO_ALPHA) ||  (pix16 == k_SHADOWBACKGD_PIXEL) ) 
    		{
    			
    			empty = spriteutils_EncodeChromakeyWshadowRun(&scanPtr, &pos, width, outBufPtr);
    		}
    		else
    		if (pix16 == shadowPixel) {
    			
    			spriteutils_EncodeShadowRun(&scanPtr, &pos, width, outBufPtr);
    		}
    		else
    		if (alpha != k_NO_ALPHA && alpha != k_ALL_ALPHA) {
    			
    			spriteutils_EncodeFeatheredRun(&scanPtr, &pos, width, outBufPtr);			
    		}
    		else {
    			
    			if (alpha == k_ALL_ALPHA)
    				spriteutils_EncodeCopyRun(&scanPtr, &pos, width, outBufPtr);
    			else {
    				printf("\nError in bitmap data.  Pixel with no associated alpha.\n");
    				exit(-1);
    			}
    		}
    	}
    
    	return empty;
    }
    
    void spriteutils_MergeShadowMap(Pixel32 *buf, Pixel32 *shadowBuf, uint16 width, uint16 height)
    {
    	Pixel32		*pixPtr, pix;
    	Pixel32		*shadowPixPtr, shadowPix;
    
    	
    	
    	BOOL		whiteBackground = FALSE;
    	if ((*shadowBuf & 0x00FFFFFF) == 0x00FFFFFF) {
    		whiteBackground = TRUE;
    	} else {
    		if ((*shadowBuf & 0x00FFFFFF) != 0x00000000) {
    			printf("\nShadow file is in invalid format.\n");
    			exit(-1);
    		}
    	}
    
    	for (sint32 j=0; j> 8) {
    					case k_CHROMAKEY_RUN_ID	:
    							destPixel += (tag & 0x00FF);
    						break;
    					case k_COPY_RUN_ID			: {
    							short len = (tag & 0x00FF);
    
    							for (short i=0; i>4);
    								destPixel++;
    								rowData--;
    							} else {
    								*destPixel++ = *rowData--;
    							}
    							tag = *rowData--;
    						break;
    					default:
    						Assert(FALSE);
    				}
    				tag = *rowData--;
    			}
    		}
    	}
    }
    
    Pixel32 spriteutils_AveragePixel32(Pixel32 pixel1, Pixel32 pixel2, Pixel32 pixel3, Pixel32 pixel4)
    {
    	Pixel16		r1, r2, r3, r4;
    	Pixel16		g1, g2, g3, g4;
    	Pixel16		b1, b2, b3, b4;
    	Pixel16		a1, a2, a3, a4;
    	Pixel32		r, g, b, a;
    	Pixel32		result;
    
    	RGB32Components(pixel1, &r1, &g1, &b1, &a1);
    	RGB32Components(pixel2, &r2, &g2, &b2, &a2);
    	RGB32Components(pixel3, &r3, &g3, &b3, &a3);
    	RGB32Components(pixel4, &r4, &g4, &b4, &a4);
    
    	r = (Pixel32)ceil((r1 + r2 + r3 + r4) / 4.0);
    	g = (Pixel32)ceil((g1 + g2 + g3 + g4) / 4.0);
    	b = (Pixel32)ceil((b1 + b2 + b3 + b4) / 4.0);
    	a = (Pixel32)ceil((a1 + a2 + a3 + a4) / 4.0);
    
    	result =  ( r | (g << 8) | (b << 16) | (a << 24));
    	
    	return result;
    }
    
    void spriteutils_CreateQuarterSize(Pixel32 *srcBuf, sint32 srcWidth, sint32 srcHeight, Pixel32 **destBuf, BOOL aa)
    {
    	sint32		destWidth = srcWidth / 2;
    	sint32		destHeight = srcHeight / 2;
    	sint32		i,j;
    	Pixel32		pixel, pixel1, pixel2, pixel3, pixel4;
    	Pixel32		*outBuf;
    
    	outBuf = (Pixel32 *)malloc(destWidth * destHeight * sizeof(Pixel32) );
    	
    	for (i=0; i> 8) {
    					case k_CHROMAKEY_RUN_ID	:
    						break;
    					case k_COPY_RUN_ID		: {
    							short len = (tag & 0x00FF);
    							for (short i=0; i> 8) {
    					case k_CHROMAKEY_RUN_ID	:
    						break;
    					case k_COPY_RUN_ID		: {
    							short len = (tag & 0x00FF);
    							for (short i=0; i 0) return 5;
    		else return 6;
    	} else {
    		if (x > 0) {
    			if (y < 0) return 1;
    			else if (y > 0) return 3;
    			else return 2;
    		} else {
    			
    			if (y < 0) return 0;
    			else if (y > 0) return 4;
    			else return 4;
    		}
    	}
    }
    I can dig more if there smething specific you need....
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  23. #203
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    And this in Sprite.cpp
    Code:
    void Sprite::ImportTGA(uint16 index, char **imageFiles,Pixel32 **imageData)
    {
    	int		bpp; 
    	int     w,h;
    
    	
    	if (!Get_TGA_Dimension(imageFiles[index], w, h, bpp)) 
    	{
    		printf("Bad TGA Sprite File(%s)\n",imageFiles[index]);
    		*imageData = NULL;
    		fcloseall();
    		exit(0);
    		return;
    	}
    
    	if (bpp!=4)
    	{
    		printf("TGA Sprite File not 32-bits\n",imageFiles[index]);
    		*imageData=NULL;
    		fcloseall();
    		exit(0);
    		return;
    	}
    	
    	*imageData = new Pixel32[w*h];
    
    	Load_TGA_File_Simple(imageFiles[index],(unsigned char *)*imageData,w*sizeof(Pixel32),w,h);
    
    	m_width  = (uint16)w;
    	m_height = (uint16)h;
    
    	
    	TGA2RGB32((Pixel32 *)*imageData,w*h);
    }
    
    
    
    
    
    void Sprite::Import(uint16 nframes, char **imageFiles, char **shadowFiles)
    {
    	m_numFrames = nframes;
    
    	
    	if (m_frames != NULL) 
    	{
    		free(m_frames);
    		m_frames = NULL;
    	}
    
    	
    	m_frames = new Pixel16*[m_numFrames];
    
    	
    	if (m_frames == NULL) 
    		return;
    
    	
    	if (m_miniframes != NULL) 
    	{
    		free(m_miniframes);
    		m_miniframes = NULL;
    	}
    
    	
    	m_miniframes = new Pixel16*[m_numFrames];
    
    	
    	if (m_miniframes == NULL) 
    		return;
    
    	
    	Pixel32 *image,*miniimage;
    	Pixel32 *shadow,*minishadow;
    
    	
    	for (uint16 i=0; i> 1, m_height >> 1);
    		}
    
    		
    		if (image) 		delete []image;
    		if (shadow)		delete []shadow;
    		if (miniimage) 	delete []miniimage;
    		if (minishadow)	delete []minishadow;
    
    		printf(".");
    	}
    }
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  24. #204
    endless_dark
    Settler
    Join Date
    06 Feb 2005
    Posts
    1
    Country
    This is endless_dark's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    Where can I find a good sprite packer/extractor that works with any sprites? All of them I have found only work for a certain game/program. I am trying to make graphics for my buddy's game, and I cant find anything that will work.

  25. #205
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    15:52
    That’s probably because there are different types of sprite file for example

    In ctp the sprite files hold graphical data however in another activsion game called star trek armada sprites contain text which can be edited in note pad so to answer you question I don't think there is one or will be one.


    however if you buddies game is ctp there is the sprite edit on martin the dane signature will work.
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  26. #206
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin, BigMC

    I revisited my crashing setler sprite. here are somethings I notice.

    At start up the fidget is great, then I move and it crashes BUT if I add an archer (another sprite I created) and move it, then I can move the settler BUT then it crashes I think its when the AI moves its settler.

    If I make everything visible and do the same add an archer it seems to work fine for awhile

    THE REAL WEIRD test was that I decided to swap my galley sprite I made in place of settler and it worked on start up. So I thought maybe it was an error with the settler sprite I copied over. So I copied settler graphics over the galley AND it still crashes!!!!!!!!!

    I think the game recognizes something unique with a settler sprite which might be the problem or maybe it is my graphics.... any suggestions???????????
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  27. #207
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    I THINK I Achieved SUCCESS

    I finally went and redid my death.tgas which were at 104x77 instead of 96x72. Before my graphics were mixed and Martin when you wanted me to mae them one size I changed them all to 104x77 and it still crashed. I think your problem is in the handling of different sizes because all ofmy 96x72 sprites work perfect.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  28. #208
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin,
    Sprie editingis going well, but I noticed that if I add fraes to a sprite the animations won't show because it remembers the original sprite frame delay. Also changing the center points do nothing also.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  29. #209
    Martin the Dane
    Prince Martin the Dane's Avatar
    Join Date
    18 Feb 2000
    Location
    Aarhus, Denmark
    Posts
    550
    Country
    This is Martin the Dane's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    16:52
    Hi E,

    I must admit I have not been working on SpriteEdit lately. I am aware of the problem with handling frame size, this is one of the reasons SpriteEdit canot create sprites from scratch. I'll have to look into the frames not beeing played.
    Visit my CTP-page and get TileEdit and a few other CTP related programs.
    Download and test SpriteEdit development build.

  30. #210
    Ekmek
    Emperor Ekmek's Avatar
    Join Date
    26 May 1999
    Posts
    3,156
    Country
    This is Ekmek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 21, 2013
    Local Time
    07:52
    Martin,
    Thanks. I'd say if anything adding the playing of all frames would be ore important than the resizing (mainly since a lot of sprites can be used as templates and I can post any bigger ones if people need them).
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

Page 7 of 8 FirstFirst ... 4 5 6 7 8 LastLast

Similar Threads

  1. Sprite Editor?
    By Pedrunn in forum CtP2-Creation/AI/Mods/Scenarios-Archive
    Replies: 1
    Last Post: June 5, 2002, 15:00
  2. Sprite editor?
    By ProvostQ in forum Civilization I and Civilization II
    Replies: 21
    Last Post: December 15, 2000, 05:24
  3. Sprite editor???????????????
    By MGamer07 in forum Civilization I and Civilization II
    Replies: 0
    Last Post: March 18, 2000, 21:56
  4. What happened to the Sprite Editor?
    By MGamer07 in forum Civilization I and Civilization II
    Replies: 3
    Last Post: February 27, 2000, 07:03
  5. Sprite Editor?
    By PrinceBimz in forum Call to Power 1
    Replies: 1
    Last Post: August 9, 1999, 05:35

Visitors found this page by searching for:

.spr editor

spr editor

civilization sprites

civilization1 sprites

sprite editor

civilization 1 spritescivilization 5 spritesedit .sprspr editor vspotlight 01 .spr downloadcivilization 1 sprite editor dosanimated avatar gifSPRITE IMAGE [.SPR] DOWNLOADciv 5 sprites downloadSPR Editor v-0.11construct 2 spritesprite editor spr files.spr file editorhoi2 mds2 sprites downloadhow to edit spr filesmds 2 spritesdelphi sprite editorsprites for construct 2edit spr filescan you rip sprites from construct 2 games

Bookmarks

Posting Permissions