Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
List
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
赤子奈落
ygopro
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;
class
ClientCard
{
public:
/*
irr::video::ITexture* curTexture;
irr::core::matrix4 mTransform;
irr::core::vector3df curPos;
...
...
@@ -112,6 +113,7 @@ public:
void ClearTarget();
static bool client_card_sort(ClientCard* c1, ClientCard* c2);
static bool deck_sort_lv(code_pointer l1, code_pointer l2);
*/
};
}
...
...
gframe/client_field.h
View file @
6b06968c
...
...
@@ -2,6 +2,7 @@
#define CLIENT_FIELD_H
#include "config.h"
/*
#include <vector>
namespace ygo {
...
...
@@ -126,7 +127,7 @@ public:
};
}
*/
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
...
...
gframe/config.h
View file @
6b06968c
...
...
@@ -45,16 +45,18 @@ inline int _wtoi(const wchar_t * s) {
}
#endif
#include <irrlicht.h>
/*
#include <irrlicht.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glu.h>
#endif
#include "CGUITTFont.h"
#include "CGUIImageButton.h"
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -67,12 +69,14 @@ inline int _wtoi(const wchar_t * s) {
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/card.h"
/*
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
*/
extern
const
unsigned
short
PRO_VERSION
;
extern
int
enable_log
;
...
...
gframe/game.cpp
View file @
6b06968c
#include "config.h"
#include "game.h"
#include "image_manager.h"
//
#include "image_manager.h"
#include "data_manager.h"
#include "deck_manager.h"
#include "replay.h"
#include "materials.h"
#include "duelclient.h"
//
#include "materials.h"
//
#include "duelclient.h"
#include "netserver.h"
#include "single_mode.h"
//
#include "single_mode.h"
#ifdef _WIN32
#include <io.h>
...
...
@@ -69,7 +69,7 @@ void Game::MainServerLoop(int bDuel_mode, int lflist) {
#endif
}
}
/*
bool Game::Initialize() {
srand(time(0));
LoadConfig();
...
...
@@ -598,6 +598,8 @@ bool Game::Initialize() {
hideChatTimer = 0;
return true;
}
*/
/*
void Game::MainLoop() {
wchar_t cap[256];
camera = smgr->addCameraSceneNode(0);
...
...
@@ -687,6 +689,8 @@ void Game::MainLoop() {
SaveConfig();
// device->drop();
}
*/
/*
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)
mProjection[i] = 0;
...
...
@@ -1113,6 +1117,7 @@ void Game::CloseDuelWindow() {
ClearTextures();
closeDoneSignal.Set();
}
*/
int
Game
::
LocalPlayer
(
int
player
)
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
}
...
...
gframe/game.h
View file @
6b06968c
...
...
@@ -2,9 +2,9 @@
#define GAME_H
#include "config.h"
#include "client_field.h"
#include "deck_con.h"
#include "menu_handler.h"
//
#include "client_field.h"
//
#include "deck_con.h"
//
#include "menu_handler.h"
#include <unordered_map>
#include <vector>
#include <list>
...
...
@@ -58,7 +58,7 @@ struct DuelInfo {
unsigned
short
time_limit
;
unsigned
short
time_left
[
2
];
};
/*
struct FadingUnit {
bool signalAction;
bool isFadein;
...
...
@@ -70,13 +70,14 @@ struct FadingUnit {
irr::core::vector2di fadingLR;
irr::core::vector2di fadingDiff;
};
*/
class
Game
{
public:
bool
Initialize
();
void
MainLoop
();
//
void MainLoop();
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 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);
...
...
@@ -102,15 +103,17 @@ public:
void AddChatMsg(wchar_t* msg, int player);
void ClearTextures();
void CloseDuelWindow();
*/
int
LocalPlayer
(
int
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);
}
*/
Mutex
gMutex
;
Mutex
gBuffer
;
Signal
frameSignal
;
...
...
@@ -122,7 +125,7 @@ public:
Config
gameConf
;
DuelInfo
dInfo
;
std
::
list
<
FadingUnit
>
fadingList
;
/*
std::list<FadingUnit> fadingList;
std::vector<int> logParam;
std::wstring chatMsg[8];
...
...
@@ -154,8 +157,9 @@ public:
bool is_building;
bool is_siding;
ClientField
dField
;
*/
/*
ClientField dField;
DeckBuilder deckBuilder;
MenuHandler menuHandler;
irr::IrrlichtDevice* device;
...
...
@@ -378,7 +382,7 @@ public:
irr::gui::IGUIButton* btnReplaySwap;
//surrender/leave
irr::gui::IGUIButton* btnLeaveGame;
*/
};
extern
Game
*
mainGame
;
...
...
gframe/gframe.cpp
View file @
6b06968c
...
...
@@ -48,15 +48,12 @@ int main(int argc, char* argv[]) {
return
0
;
}
/*
ygo::mainGame = &_game;
if(!ygo::mainGame->Initialize())
return 0;
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') {
ygo::dataManager.LoadDB(&argv[i][2]);
} 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[]) {
#ifdef _WIN32
WSACleanup();
#else
#endif //_WIN32
*/
return
EXIT_SUCCESS
;
}
gframe/premake4.lua
View file @
6b06968c
...
...
@@ -3,10 +3,18 @@ include "lzma"
project
"ygopro"
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/**"
includedirs
{
"../ocgcore"
}
links
{
"ocgcore"
,
"clzma"
,
"
Irrlicht"
,
"freetype"
,
"
sqlite3"
,
"lua"
,
"event"
}
links
{
"ocgcore"
,
"clzma"
,
"sqlite3"
,
"lua"
,
"event"
}
configuration
"windows"
files
"ygopro.rc"
...
...
gframe/single_duel.cpp
View file @
6b06968c
...
...
@@ -1510,7 +1510,7 @@ int SingleDuel::MessageHandler(long fduel, int type) {
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
//
mainGame->AddChatMsg(wbuf, 9);
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
...
...
gframe/tag_duel.cpp
View file @
6b06968c
...
...
@@ -1619,7 +1619,7 @@ int TagDuel::MessageHandler(long fduel, int type) {
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
//
mainGame->AddChatMsg(wbuf, 9);
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
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