Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
6b06968c
Commit
6b06968c
authored
Jan 01, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change to server only
parent
bd7605d8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
33 deletions
+55
-33
gframe/client_card.h
gframe/client_card.h
+2
-0
gframe/client_field.h
gframe/client_field.h
+2
-1
gframe/config.h
gframe/config.h
+8
-4
gframe/game.cpp
gframe/game.cpp
+10
-5
gframe/game.h
gframe/game.h
+18
-14
gframe/gframe.cpp
gframe/gframe.cpp
+3
-5
gframe/premake4.lua
gframe/premake4.lua
+10
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
No files found.
gframe/client_card.h
View file @
6b06968c
...
@@ -45,6 +45,7 @@ typedef std::unordered_map<unsigned int, CardDataC>::iterator code_pointer;
...
@@ -45,6 +45,7 @@ typedef std::unordered_map<unsigned int, CardDataC>::iterator code_pointer;
class
ClientCard
{
class
ClientCard
{
public:
public:
/*
irr::video::ITexture* curTexture;
irr::video::ITexture* curTexture;
irr::core::matrix4 mTransform;
irr::core::matrix4 mTransform;
irr::core::vector3df curPos;
irr::core::vector3df curPos;
...
@@ -112,6 +113,7 @@ public:
...
@@ -112,6 +113,7 @@ public:
void ClearTarget();
void ClearTarget();
static bool client_card_sort(ClientCard* c1, ClientCard* c2);
static bool client_card_sort(ClientCard* c1, ClientCard* c2);
static bool deck_sort_lv(code_pointer l1, code_pointer l2);
static bool deck_sort_lv(code_pointer l1, code_pointer l2);
*/
};
};
}
}
...
...
gframe/client_field.h
View file @
6b06968c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define CLIENT_FIELD_H
#define CLIENT_FIELD_H
#include "config.h"
#include "config.h"
/*
#include <vector>
#include <vector>
namespace ygo {
namespace ygo {
...
@@ -126,7 +127,7 @@ public:
...
@@ -126,7 +127,7 @@ public:
};
};
}
}
*/
//special cards
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
#define CARD_TWINKLE_MOSS 13857930
...
...
gframe/config.h
View file @
6b06968c
...
@@ -45,16 +45,18 @@ inline int _wtoi(const wchar_t * s) {
...
@@ -45,16 +45,18 @@ inline int _wtoi(const wchar_t * s) {
}
}
#endif
#endif
#include <irrlicht.h>
/*
#include <irrlicht.h>
#ifdef __APPLE__
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glu.h>
#else
#else
#include <GL/gl.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glu.h>
#endif
#endif
#include "CGUITTFont.h"
#include "CGUITTFont.h"
#include "CGUIImageButton.h"
#include "CGUIImageButton.h"
*/
#include <iostream>
#include <iostream>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -67,12 +69,14 @@ inline int _wtoi(const wchar_t * s) {
...
@@ -67,12 +69,14 @@ inline int _wtoi(const wchar_t * s) {
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/card.h"
#include "../ocgcore/card.h"
/*
using namespace irr;
using namespace irr;
using namespace core;
using namespace core;
using namespace scene;
using namespace scene;
using namespace video;
using namespace video;
using namespace io;
using namespace io;
using namespace gui;
using namespace gui;
*/
extern
const
unsigned
short
PRO_VERSION
;
extern
const
unsigned
short
PRO_VERSION
;
extern
int
enable_log
;
extern
int
enable_log
;
...
...
gframe/game.cpp
View file @
6b06968c
#include "config.h"
#include "config.h"
#include "game.h"
#include "game.h"
#include "image_manager.h"
//
#include "image_manager.h"
#include "data_manager.h"
#include "data_manager.h"
#include "deck_manager.h"
#include "deck_manager.h"
#include "replay.h"
#include "replay.h"
#include "materials.h"
//
#include "materials.h"
#include "duelclient.h"
//
#include "duelclient.h"
#include "netserver.h"
#include "netserver.h"
#include "single_mode.h"
//
#include "single_mode.h"
#ifdef _WIN32
#ifdef _WIN32
#include <io.h>
#include <io.h>
...
@@ -69,7 +69,7 @@ void Game::MainServerLoop(int bDuel_mode, int lflist) {
...
@@ -69,7 +69,7 @@ void Game::MainServerLoop(int bDuel_mode, int lflist) {
#endif
#endif
}
}
}
}
/*
bool Game::Initialize() {
bool Game::Initialize() {
srand(time(0));
srand(time(0));
LoadConfig();
LoadConfig();
...
@@ -598,6 +598,8 @@ bool Game::Initialize() {
...
@@ -598,6 +598,8 @@ bool Game::Initialize() {
hideChatTimer = 0;
hideChatTimer = 0;
return true;
return true;
}
}
*/
/*
void Game::MainLoop() {
void Game::MainLoop() {
wchar_t cap[256];
wchar_t cap[256];
camera = smgr->addCameraSceneNode(0);
camera = smgr->addCameraSceneNode(0);
...
@@ -687,6 +689,8 @@ void Game::MainLoop() {
...
@@ -687,6 +689,8 @@ void Game::MainLoop() {
SaveConfig();
SaveConfig();
// device->drop();
// device->drop();
}
}
*/
/*
void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) {
void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) {
for(int i = 0; i < 16; ++i)
for(int i = 0; i < 16; ++i)
mProjection[i] = 0;
mProjection[i] = 0;
...
@@ -1113,6 +1117,7 @@ void Game::CloseDuelWindow() {
...
@@ -1113,6 +1117,7 @@ void Game::CloseDuelWindow() {
ClearTextures();
ClearTextures();
closeDoneSignal.Set();
closeDoneSignal.Set();
}
}
*/
int
Game
::
LocalPlayer
(
int
player
)
{
int
Game
::
LocalPlayer
(
int
player
)
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
return
dInfo
.
isFirst
?
player
:
1
-
player
;
}
}
...
...
gframe/game.h
View file @
6b06968c
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
#define GAME_H
#define GAME_H
#include "config.h"
#include "config.h"
#include "client_field.h"
//
#include "client_field.h"
#include "deck_con.h"
//
#include "deck_con.h"
#include "menu_handler.h"
//
#include "menu_handler.h"
#include <unordered_map>
#include <unordered_map>
#include <vector>
#include <vector>
#include <list>
#include <list>
...
@@ -58,7 +58,7 @@ struct DuelInfo {
...
@@ -58,7 +58,7 @@ struct DuelInfo {
unsigned
short
time_limit
;
unsigned
short
time_limit
;
unsigned
short
time_left
[
2
];
unsigned
short
time_left
[
2
];
};
};
/*
struct FadingUnit {
struct FadingUnit {
bool signalAction;
bool signalAction;
bool isFadein;
bool isFadein;
...
@@ -70,13 +70,14 @@ struct FadingUnit {
...
@@ -70,13 +70,14 @@ struct FadingUnit {
irr::core::vector2di fadingLR;
irr::core::vector2di fadingLR;
irr::core::vector2di fadingDiff;
irr::core::vector2di fadingDiff;
};
};
*/
class
Game
{
class
Game
{
public:
public:
bool
Initialize
();
bool
Initialize
();
void
MainLoop
();
//
void MainLoop();
void
MainServerLoop
(
int
bDuel_mode
,
int
lflist
);
void
MainServerLoop
(
int
bDuel_mode
,
int
lflist
);
/*
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
void SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0);
void SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0);
...
@@ -102,15 +103,17 @@ public:
...
@@ -102,15 +103,17 @@ public:
void AddChatMsg(wchar_t* msg, int player);
void AddChatMsg(wchar_t* msg, int player);
void ClearTextures();
void ClearTextures();
void CloseDuelWindow();
void CloseDuelWindow();
*/
int
LocalPlayer
(
int
player
);
int
LocalPlayer
(
int
player
);
const
wchar_t
*
LocalName
(
int
local_player
);
const
wchar_t
*
LocalName
(
int
local_player
);
bool
HasFocus
(
EGUI_ELEMENT_TYPE
type
)
const
{
/*
irr
::
gui
::
IGUIElement
*
focus
=
env
->
getFocus
();
bool HasFocus(EGUI_ELEMENT_TYPE type) const {
//irr::gui::IGUIElement* focus = env->getFocus();
return focus && focus->hasType(type);
return focus && focus->hasType(type);
}
}
*/
Mutex
gMutex
;
Mutex
gMutex
;
Mutex
gBuffer
;
Mutex
gBuffer
;
Signal
frameSignal
;
Signal
frameSignal
;
...
@@ -122,7 +125,7 @@ public:
...
@@ -122,7 +125,7 @@ public:
Config
gameConf
;
Config
gameConf
;
DuelInfo
dInfo
;
DuelInfo
dInfo
;
std
::
list
<
FadingUnit
>
fadingList
;
/*
std::list<FadingUnit> fadingList;
std::vector<int> logParam;
std::vector<int> logParam;
std::wstring chatMsg[8];
std::wstring chatMsg[8];
...
@@ -154,8 +157,9 @@ public:
...
@@ -154,8 +157,9 @@ public:
bool is_building;
bool is_building;
bool is_siding;
bool is_siding;
*/
ClientField
dField
;
/*
ClientField dField;
DeckBuilder deckBuilder;
DeckBuilder deckBuilder;
MenuHandler menuHandler;
MenuHandler menuHandler;
irr::IrrlichtDevice* device;
irr::IrrlichtDevice* device;
...
@@ -378,7 +382,7 @@ public:
...
@@ -378,7 +382,7 @@ public:
irr::gui::IGUIButton* btnReplaySwap;
irr::gui::IGUIButton* btnReplaySwap;
//surrender/leave
//surrender/leave
irr::gui::IGUIButton* btnLeaveGame;
irr::gui::IGUIButton* btnLeaveGame;
*/
};
};
extern
Game
*
mainGame
;
extern
Game
*
mainGame
;
...
...
gframe/gframe.cpp
View file @
6b06968c
...
@@ -48,15 +48,12 @@ int main(int argc, char* argv[]) {
...
@@ -48,15 +48,12 @@ int main(int argc, char* argv[]) {
return
0
;
return
0
;
}
}
/*
ygo::mainGame = &_game;
ygo::mainGame = &_game;
if(!ygo::mainGame->Initialize())
if(!ygo::mainGame->Initialize())
return 0;
return 0;
for(int i = 1; i < argc; ++i) {
for(int i = 1; i < argc; ++i) {
/*command line args:
* -j: join host (host info from system.conf)
* -d: deck edit
* -r: replay */
if(argv[i][0] == '-' && argv[i][1] == 'e') {
if(argv[i][0] == '-' && argv[i][1] == 'e') {
ygo::dataManager.LoadDB(&argv[i][2]);
ygo::dataManager.LoadDB(&argv[i][2]);
} else if(!strcmp(argv[i], "-j") || !strcmp(argv[i], "-d") || !strcmp(argv[i], "-r") || !strcmp(argv[i], "-s")) {
} else if(!strcmp(argv[i], "-j") || !strcmp(argv[i], "-d") || !strcmp(argv[i], "-r") || !strcmp(argv[i], "-s")) {
...
@@ -93,7 +90,8 @@ int main(int argc, char* argv[]) {
...
@@ -93,7 +90,8 @@ int main(int argc, char* argv[]) {
#ifdef _WIN32
#ifdef _WIN32
WSACleanup();
WSACleanup();
#else
#else
#endif //_WIN32
#endif //_WIN32
*/
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
gframe/premake4.lua
View file @
6b06968c
...
@@ -3,10 +3,18 @@ include "lzma"
...
@@ -3,10 +3,18 @@ include "lzma"
project
"ygopro"
project
"ygopro"
kind
"WindowedApp"
kind
"WindowedApp"
files
{
"**.cpp"
,
"**.cc"
,
"**.c"
,
"**.h"
}
files
{
"gframe.cpp"
,
"config.h"
,
"game.cpp"
,
"game.h"
,
"deck_manager.cpp"
,
"deck_manager.h"
,
"data_manager.cpp"
,
"data_manager.h"
,
"replay.cpp"
,
"replay.h"
,
"netserver.cpp"
,
"netserver.h"
,
"single_duel.cpp"
,
"single_duel.h"
,
"tag_duel.cpp"
,
"tag_duel.h"
,
"**.cc"
,
"**.c"
}
excludes
"lzma/**"
excludes
"lzma/**"
includedirs
{
"../ocgcore"
}
includedirs
{
"../ocgcore"
}
links
{
"ocgcore"
,
"clzma"
,
"
Irrlicht"
,
"freetype"
,
"
sqlite3"
,
"lua"
,
"event"
}
links
{
"ocgcore"
,
"clzma"
,
"sqlite3"
,
"lua"
,
"event"
}
configuration
"windows"
configuration
"windows"
files
"ygopro.rc"
files
"ygopro.rc"
...
...
gframe/single_duel.cpp
View file @
6b06968c
...
@@ -1510,7 +1510,7 @@ int SingleDuel::MessageHandler(long fduel, int type) {
...
@@ -1510,7 +1510,7 @@ int SingleDuel::MessageHandler(long fduel, int type) {
if
(
enable_log
==
1
)
{
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
//
mainGame->AddChatMsg(wbuf, 9);
}
else
if
(
enable_log
==
2
)
{
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
if
(
!
fp
)
...
...
gframe/tag_duel.cpp
View file @
6b06968c
...
@@ -1619,7 +1619,7 @@ int TagDuel::MessageHandler(long fduel, int type) {
...
@@ -1619,7 +1619,7 @@ int TagDuel::MessageHandler(long fduel, int type) {
if
(
enable_log
==
1
)
{
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
//
mainGame->AddChatMsg(wbuf, 9);
}
else
if
(
enable_log
==
2
)
{
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
if
(
!
fp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment