Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: youngershen/Fight_zero
base: 026253bf5f
...
head fork: youngershen/Fight_zero
compare: 837b4821c5
  • 2 commits
  • 33 files changed
  • 0 commit comments
  • 1 contributor
Showing with 198 additions and 9 deletions.
  1. BIN  Debug/Fight_zero.exe
  2. BIN  Debug/Fight_zero.ilk
  3. BIN  Debug/Fight_zero.pdb
  4. BIN  Debug/SDL.dll
  5. BIN  Debug/SDL_image.dll
  6. BIN  Debug/libpng15-15.dll
  7. BIN  Debug/python27.dll
  8. BIN  Debug/zlib1.dll
  9. BIN  Fight_zero.ncb
  10. BIN  Fight_zero.suo
  11. BIN  Fight_zero/Debug/BuildLog.htm
  12. BIN  Fight_zero/Debug/Fight_zero.obj
  13. BIN  Fight_zero/Debug/GameAnimationFactory.obj
  14. BIN  Fight_zero/Debug/GameStageObject.obj
  15. BIN  Fight_zero/Debug/MagicianStandAnimation_2.obj
  16. BIN  Fight_zero/Debug/MagicianWalkAnimation_1.obj
  17. BIN  Fight_zero/Debug/MagicianWalkAnimation_2.obj
  18. BIN  Fight_zero/Debug/Surface.obj
  19. +1 −1  Fight_zero/Debug/mt.dep
  20. BIN  Fight_zero/Debug/vc90.idb
  21. BIN  Fight_zero/Debug/vc90.pdb
  22. +22 −8 Fight_zero/Fight_zero.cpp
  23. +24 −0 Fight_zero/Fight_zero.vcproj
  24. +39 −0 Fight_zero/GameAnimationFactory.cpp
  25. +26 −0 Fight_zero/GameAnimationFactory.h
  26. +10 −0 Fight_zero/GameStageObject.cpp
  27. +8 −0 Fight_zero/GameStageObject.h
  28. +38 −0 Fight_zero/MagicianWalkAnimation_2.cpp
  29. +22 −0 Fight_zero/MagicianWalkAnimation_2.h
  30. +7 −0 Fight_zero/Surface.cpp
  31. +1 −0  Fight_zero/Surface.h
  32. BIN  Fight_zero/resource/actors/magician/mofashi-stand-2.png
  33. BIN  Fight_zero/resource/actors/magician/mofashi-stand-21.png
View
BIN  Debug/Fight_zero.exe
Binary file not shown
View
BIN  Debug/Fight_zero.ilk
Binary file not shown
View
BIN  Debug/Fight_zero.pdb
Binary file not shown
View
BIN  Debug/SDL.dll
Binary file not shown
View
BIN  Debug/SDL_image.dll
Binary file not shown
View
BIN  Debug/libpng15-15.dll
Binary file not shown
View
BIN  Debug/python27.dll
Binary file not shown
View
BIN  Debug/zlib1.dll
Binary file not shown
View
BIN  Fight_zero.ncb
Binary file not shown
View
BIN  Fight_zero.suo
Binary file not shown
View
BIN  Fight_zero/Debug/BuildLog.htm
Binary file not shown
View
BIN  Fight_zero/Debug/Fight_zero.obj
Binary file not shown
View
BIN  Fight_zero/Debug/GameAnimationFactory.obj
Binary file not shown
View
BIN  Fight_zero/Debug/GameStageObject.obj
Binary file not shown
View
BIN  Fight_zero/Debug/MagicianStandAnimation_2.obj
Binary file not shown
View
BIN  Fight_zero/Debug/MagicianWalkAnimation_1.obj
Binary file not shown
View
BIN  Fight_zero/Debug/MagicianWalkAnimation_2.obj
Binary file not shown
View
BIN  Fight_zero/Debug/Surface.obj
Binary file not shown
View
2  Fight_zero/Debug/mt.dep
@@ -1 +1 @@
-Manifest resource last updated at 17:52:15.74 on 2012/05/02 ����
+Manifest resource last updated at 21:28:58.86 on 2012/05/02 ����
View
BIN  Fight_zero/Debug/vc90.idb
Binary file not shown
View
BIN  Fight_zero/Debug/vc90.pdb
Binary file not shown
View
30 Fight_zero/Fight_zero.cpp
@@ -6,7 +6,9 @@
#include "GameConfig.h"
#include "Surface.h"
#include "MagicianWalkAnimation.h"
-
+#include "MagicianWalkAnimation_1.h"
+#include "MagicianStandAnimation_2.h"
+#include "GameAnimationFactory.h"
#include <windows.h>
#include <iostream>
#pragma comment(lib,"SDL.lib")
@@ -22,7 +24,11 @@ SDL_Surface * player;
SDL_Rect rect;
SDL_Rect rect2;
SDL_Rect rect3;
-FZ::animation::MagicianWalkAnimation * anima;
+FZ::GameAnimation* anima;
+
+int m_x = 0;
+int m_y = 0;
+
int _tmain(int argc, _TCHAR* argv[])
{
@@ -39,12 +45,20 @@ int _tmain(int argc, _TCHAR* argv[])
rect2.y = 262;
screen = FZ::GameConfig::init_game("sd","",400,640);
+ SDL_Surface * sc = FZ::Surface::create_surface(640,400);
+ //SDL_FillRect(sc,0,SDL_MapRGB(sc->format,255,255,255));
+ //SDL_SetAlpha(sc, SDL_SRCALPHA, 0);
player = FZ::Surface::on_load("./resource/actors/magician/mofashi-stand-2.png");
- anima = new FZ::animation::MagicianWalkAnimation(6,8,player,60,131,screen);
+ FZ::Surface::on_draw(sc,NULL,screen,0,0);
+ SDL_Flip(screen);
+ anima = FZ::utils::GameAnimationFactory::get_magician_walk_animation_2(sc);
cout<<anima->clips.size()<<endl;
cout<<SDL_GetTicks()<<endl;
-
+ FZ::Surface::on_draw(player,&rect,sc,0,0);
+
+ SDL_Flip(sc);
+ //SDL_UpdateRect(sc, 0, 0, 0, 0);
while(true){
SDL_Event event;
@@ -55,9 +69,9 @@ int _tmain(int argc, _TCHAR* argv[])
//SDL_UpdateRect(screen, 0, 0, 0, 0);
// FZ::Surface::on_draw(player,&rect3,screen,0,0);
//SDL_Flip(screen);
- // SDL_FillRect(screen, NULL, 0);
- anima->on_draw(0,0);
- SDL_Flip(screen);
+ //SDL_FillRect(sc, NULL, 0);
+ //anima->on_draw(m_x,m_y);
+ //SDL_Flip(sc);
}
return 0;
@@ -88,7 +102,7 @@ void event_line(SDL_Event event)
break;
case SDLK_RIGHT: cout<<"right"<<endl;
-
+ m_x+=20;
break;
}
}
View
24 Fight_zero/Fight_zero.vcproj
@@ -179,6 +179,10 @@
>
</File>
<File
+ RelativePath=".\GameAnimationFactory.cpp"
+ >
+ </File>
+ <File
RelativePath=".\GameConfig.cpp"
>
</File>
@@ -187,6 +191,10 @@
>
</File>
<File
+ RelativePath=".\GameStageObject.cpp"
+ >
+ </File>
+ <File
RelativePath=".\MagicianStandAnimation_1.cpp"
>
</File>
@@ -203,6 +211,10 @@
>
</File>
<File
+ RelativePath=".\MagicianWalkAnimation_2.cpp"
+ >
+ </File>
+ <File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
@@ -237,6 +249,10 @@
>
</File>
<File
+ RelativePath=".\GameAnimationFactory.h"
+ >
+ </File>
+ <File
RelativePath=".\GameConfig.h"
>
</File>
@@ -245,6 +261,10 @@
>
</File>
<File
+ RelativePath=".\GameStageObject.h"
+ >
+ </File>
+ <File
RelativePath=".\MagicianStandAnimation_1.h"
>
</File>
@@ -261,6 +281,10 @@
>
</File>
<File
+ RelativePath=".\MagicianWalkAnimation_2.h"
+ >
+ </File>
+ <File
RelativePath=".\stdafx.h"
>
</File>
View
39 Fight_zero/GameAnimationFactory.cpp
@@ -0,0 +1,39 @@
+#include "StdAfx.h"
+#include "GameAnimationFactory.h"
+
+FZ::utils::GameAnimationFactory::GameAnimationFactory(void)
+{
+}
+
+FZ::utils::GameAnimationFactory::~GameAnimationFactory(void)
+{
+}
+
+
+FZ::GameAnimation * FZ::utils::GameAnimationFactory::get_magician_walk_animation_2(SDL_Surface * screen)
+{
+ SDL_Surface * player = FZ::Surface::on_load("./resource/actors/magician/mofashi-walk-1.png");
+ FZ::animation::MagicianWalkAnimation_2* animation = new FZ::animation::MagicianWalkAnimation_2(6,8,player,74,122,screen);
+ return animation;
+}
+
+FZ::GameAnimation * FZ::utils::GameAnimationFactory::get_magician_stand_animation_1(SDL_Surface *screen)
+{
+ SDL_Surface * player = FZ::Surface::on_load("./resource/actors/magician/mofashi-stand-2.png");
+ FZ::animation::MagicianStandAnimation_1 * animation = new FZ::animation::MagicianStandAnimation_1(6,8,player,60,131,screen);
+ return animation;
+}
+
+FZ::GameAnimation * FZ::utils::GameAnimationFactory::get_magician_stand_animation_2(SDL_Surface *screen)
+{
+ SDL_Surface * player = FZ::Surface::on_load("./resource/actors/magician/mofashi-stand-2.png");
+ FZ::animation::MagicianStandAnimation_2 * animation = new FZ::animation::MagicianStandAnimation_2(6,8,player,60,131,screen);
+ return animation;
+}
+
+FZ::GameAnimation * FZ::utils::GameAnimationFactory::get_magician_walk_animation_1(SDL_Surface * screen)
+{
+ SDL_Surface * player = FZ::Surface::on_load("./resource/actors/magician/mofashi-walk-1.png");
+ FZ::animation::MagicianWalkAnimation_1* animation = new FZ::animation::MagicianWalkAnimation_1(6,8,player,74,122,screen);
+ return animation;
+}
View
26 Fight_zero/GameAnimationFactory.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "SDL.h"
+#include "Surface.h"
+#include "GameAnimation.h"
+#include "MagicianStandAnimation_1.h"
+#include "MagicianStandAnimation_2.h"
+#include "MagicianWalkAnimation_1.h"
+#include "MagicianWalkAnimation_2.h"
+
+namespace FZ{
+
+ namespace utils{
+
+ class GameAnimationFactory
+ {
+ public:
+ GameAnimationFactory(void);
+ ~GameAnimationFactory(void);
+ static FZ::GameAnimation * get_magician_stand_animation_1(SDL_Surface * screen);
+ static FZ::GameAnimation * get_magician_stand_animation_2(SDL_Surface * screen);
+ static FZ::GameAnimation * get_magician_walk_animation_1(SDL_Surface * screen);
+ static FZ::GameAnimation * get_magician_walk_animation_2(SDL_Surface * screen);
+ };
+
+ };
+};
View
10 Fight_zero/GameStageObject.cpp
@@ -0,0 +1,10 @@
+#include "StdAfx.h"
+#include "GameStageObject.h"
+
+GameStageObject::GameStageObject(void)
+{
+}
+
+GameStageObject::~GameStageObject(void)
+{
+}
View
8 Fight_zero/GameStageObject.h
@@ -0,0 +1,8 @@
+#pragma once
+
+class GameStageObject
+{
+public:
+ GameStageObject(void);
+ ~GameStageObject(void);
+};
View
38 Fight_zero/MagicianWalkAnimation_2.cpp
@@ -0,0 +1,38 @@
+#include "StdAfx.h"
+#include "MagicianWalkAnimation_2.h"
+
+FZ::animation::MagicianWalkAnimation_2::MagicianWalkAnimation_2(void)
+{
+}
+
+FZ::animation::MagicianWalkAnimation_2::~MagicianWalkAnimation_2(void)
+{
+}
+
+FZ::animation::MagicianWalkAnimation_2::MagicianWalkAnimation_2(int animate_rate, int animate_length, SDL_Surface *sprite, int width, int height, SDL_Surface *dest): GameAnimation(animate_rate,animate_length,sprite,width,height,dest)
+{
+
+ this->init_clips();
+}
+
+void FZ::animation::MagicianWalkAnimation_2::init_clips(void)
+{
+ int length = this->animate_length;
+ int width = this->width;
+ int height = this->height;
+ int rows = length / 4;
+
+ for(int i = 0 ; i< rows;i++)
+ {
+ for(int n = 0 ; n < 4;n ++)
+ {
+ SDL_Rect rect;
+ rect.w = width;
+ rect.h = height;
+ rect.x = n * width;
+ rect.y = (2+i) * height;
+ this->clips.push_back(rect);
+ }
+ }
+
+}
View
22 Fight_zero/MagicianWalkAnimation_2.h
@@ -0,0 +1,22 @@
+#pragma once
+#include "SDL.h"
+#include "GameAnimation.h"
+#include <iostream>
+
+using namespace std;
+
+namespace FZ{
+
+ namespace animation{
+
+ class MagicianWalkAnimation_2 : public GameAnimation
+ {
+ public:
+ MagicianWalkAnimation_2(int animate_rate,int animate_length,SDL_Surface * sprite,int width,int height,SDL_Surface * dest);
+ MagicianWalkAnimation_2(void);
+ ~MagicianWalkAnimation_2(void);
+ virtual void init_clips(void);
+ };
+
+ };
+};
View
7 Fight_zero/Surface.cpp
@@ -80,4 +80,11 @@ SDL_Surface * FZ::Surface::load_png_img(std::string path)
return image_surface;
+}
+
+SDL_Surface * FZ::Surface::create_surface(int width,int height)
+{
+ SDL_Surface * surface;
+ surface=SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,32,0,0,0,0);
+ return surface;
}
View
1  Fight_zero/Surface.h
@@ -17,6 +17,7 @@ namespace FZ{
~Surface(void);
static SDL_Surface * on_load(string path);
static bool on_draw(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,int dx,int dy);
+ static SDL_Surface * create_surface(int width,int height);
private :
static SDL_Surface * load_bmp_img(string path);
static SDL_Surface * load_png_img(string path);
View
BIN  Fight_zero/resource/actors/magician/mofashi-stand-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Fight_zero/resource/actors/magician/mofashi-stand-21.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

No commit comments for this range

Something went wrong with that request. Please try again.