Commits

Anonymous committed 5da8b26

Implemented 320x240 res, finished 640x480 res move. Simply batch converted bmp's to 50% size.
Current sound files are duplicated between the 2 sizes.

  • Participants
  • Parent commits f86557f

Comments (0)

Files changed (24)

 CBg::CBg(const char *path)
 {
 	SDL_Surface *image_bmp;
+	char local_path[MYMAXPATH];
 	
 	printf("Budu nahravat obrazek %s\n", path);
-	image_bmp = SDL_LoadBMP(path);
+	sprintf(local_path, "%s%s", GFXPATH, path);
+	image_bmp = SDL_LoadBMP(local_path);
 	if (image_bmp == NULL) {
 		CSystem::problemSDL(__FILE__, __LINE__, __FUNCTION__);
 	}
 	SDL_Rect dest;
 
 	// nejlepe je surface->w == mPas->w
+#ifdef DEBUG
+	printf("surface->w=%d, mPas->w=%d, surface->h=%d, mPas->h=%d\n", surface->w, mPas->w, surface->h, mPas->h);
+#endif /* DEBUG */
 	assert(surface->w == mPas->w && surface->h <= mPas->h);
 			
 	dest.x = 0;
 class CMove {
 	public:
 		// rozmery herni plochy
-		static const int sPlochaWidth = 640;
-		static const int sPlochaHeight = 480;
+/*
+#define SCREEN_WIDTH 640
+#define SCREEN_HEIGHT 480
+#define SCREEN_WIDTH 320
+#define SCREEN_HEIGHT 240
+*/
+		static const int sPlochaWidth = SCREEN_WIDTH;
+		static const int sPlochaHeight = SCREEN_HEIGHT;
 
 		// primitivne stoji na miste, 
 		// vraci treu jestlize definitivne odletl
 {
 	SDL_Surface *image_bmp;
 	SDL_Surface *surface;
-#define MYMAXPATH 255
 	char local_path[MYMAXPATH];
 
 	printf("Budu nahravat obrazek %s\n", path);
 
 /*
 #define DIRSEP "\\"
+#define GFXDIR "gfx640x480"
+#define GFXDIR "gfx320x240"
 */
 #define DIRSEP "/"
+/*
+#define GFXDIR "gfx" #SCREEN_WIDTH "x" #SCREEN_HEIGHT
+*/
+#if SCREEN_WIDTH == 640 && SCREEN_HEIGHT == 480
 #define GFXDIR "gfx640x480"
+#elif SCREEN_WIDTH == 320 && SCREEN_HEIGHT == 240
+#define GFXDIR "gfx320x240"
+#endif
+
 #define GFXPATH GFXDIR DIRSEP
 
 
 CC = g++
 CFLAGS = $(shell sdl-config --cflags) -O3 #-pg #-g # -DNDEBUG
 CFLAGS += -DSHIPS_IGNORE_SOUND_FAILURE
+CFLAGS += -DMYMAXPATH=255
+CFLAGS += -DSCREEN_WIDTH=640 -DSCREEN_HEIGHT=480 # -DGFXDIR=gfx640x480
+#CFLAGS += -DSCREEN_WIDTH=320 -DSCREEN_HEIGHT=240 # -DGFXDIR=gfx320x240
+#define GFXDIR "gfx640x480"
+#define GFXDIR "gfx320x240"
+CFLAGS += -DDEBUG
+
 
 # Warning flags for C programs
 WARNCFLAGS = -Wall -Wshadow -Wpointer-arith \

bg/space_pas.bmp

Removed
Old image

gfx320x240/bg/space_pas.bmp

Added
New image

gfx320x240/body/lod.wav

Binary file added.

gfx320x240/body/shot.wav

Binary file added.

gfx320x240/body/shot_down.bmp

Added
New image

gfx320x240/body/shot_up.bmp

Added
New image

gfx320x240/body/stihacka_down.bmp

Added
New image

gfx320x240/body/stihacka_up.bmp

Added
New image

gfx320x240/body/talir_down.bmp

Added
New image

gfx320x240/body/talir_up.bmp

Added
New image

gfx320x240/body/ufon_down.bmp

Added
New image

gfx320x240/body/ufon_up.bmp

Added
New image

gfx320x240/weapon/cannon_down.bmp

Added
New image

gfx320x240/weapon/cannon_up.bmp

Added
New image

gfx320x240/weapon/fork_down.bmp

Added
New image

gfx320x240/weapon/fork_up.bmp

Added
New image

gfx320x240/weapon/magnet_down.bmp

Added
New image

gfx320x240/weapon/magnet_up.bmp

Added
New image

gfx640x480/bg/space_pas.bmp

Added
New image