Skip to content

Commit

Permalink
new water test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
turesnake committed Feb 19, 2020
1 parent a16d3cb commit 1585f5d
Show file tree
Hide file tree
Showing 128 changed files with 719 additions and 531 deletions.
9 changes: 4 additions & 5 deletions Docs/GameSys/Property.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#ifndef _TPR_PROPERTY_H_
#define _TPR_PROPERTY_H_

//------------------- Libs --------------------//
#include "tprDataType.h"
//----------------- CPP ------------------//
#include <cstdint> // uint8_t


//- 各种属性的 抗性等级 --
enum class ResisLvl : u8{
enum class ResisLvl : uint8_t{
Weak, //- 伤害加倍 (弱)
Norm, //- 正常伤害 (default)
Half, //- 伤害减半
Expand All @@ -27,7 +27,6 @@ enum class ResisLvl : u8{




struct ResisOfElement{
ResisLvl lighting {ResisLvl::Norm}; //- 电
ResisLvl poison {ResisLvl::Norm}; //- 毒
Expand All @@ -54,7 +53,7 @@ class Property{
ResisOfElement resisOfElement {}; //- 各属性抗性等级


u32 resisOfStates {}; //- bitmap,异常状态免疫表
uint32_t resisOfStates {}; //- bitmap,异常状态免疫表
// 是否对某个异常状态 免疫( 1:免疫。 0:不免疫 )
// 这部分可以专门制作一个 class
// ----------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The recommended compiler is **Clang**, even if in **Win10**.
Make sure the compiler version support **C++17**.


## How to Installation
## How to Install

### Mac OS X

Expand Down
68 changes: 0 additions & 68 deletions deps/tprGeneral/tprDataType.h

This file was deleted.

3 changes: 0 additions & 3 deletions deps/tprInWin/tprFileSys_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

#include <string>

#include "tprDataType.h"


namespace tprWin {//--------------- namespace: tprWin -------------------//


Expand Down
2 changes: 2 additions & 0 deletions gameObjDatas/_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
{"oneEyeBoy/_oneEyeBoy.go.json": true },
{"playerGoCircle/_playerGoCircle.go.json": true },

{"riverBank/_riverBank.go.json": true },

{"hollowLog/_go.json": true },

{"rocks/_rock.go.json": true },
Expand Down
28 changes: 28 additions & 0 deletions gameObjDatas/riverBank/_riverBank.afs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"afsName": "riverBank",
"pngs": [
{
"path": "riverBank.P.png",
"frameNum.col": 5,
"frameNum.row": 1,
"totalFrameNum": 5,
"isHaveShadow": false,
"isPjtSingle": true,
"ColliderType": "Nil",
"subspecs": [
{
"type": "batch",
"animLabel": "",
"fstSubIdx": 0,
"fstIdx": 0,
"idxNums": 5,
"actionEName": "Idle", "dir": "Center", "brokenLvl": 0,
"isOpaque": true
}
]
}
]
}

]
30 changes: 30 additions & 0 deletions gameObjDatas/riverBank/_riverBank.go.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"goSpeciesName": "riverBank",
"family": "Floor",
"state": "Waked",
"moveState": "AbsFixed",
"isMoveCollide": false,
"isDoPass": false,
"isBePass": true,

"alti": 0,
"lAltiRanges": [
{ "label": "", "val": [0.0, 0.0] }
],
"defaultGoAltiRangeLabel": "",

"weight": 1,
"pub.HP": "nil",
"pub.MP": "nil",


"afs_lPaths": [
"_riverBank.afs.json"

],
"multiGoMesh_lPaths": []


}
]
Binary file added gameObjDatas/riverBank/riverBank.J.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gameObjDatas/riverBank/riverBank.P.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions jsons/ecoSysPlans/_files.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[
{ "Desert.json": false },

{ "Savannah.json": false },
{ "Savannah.json": true },

{ "Forest_1.json": true },
{ "Forest_1.json": false },

{ "DarkForest_1.json": false },
{ "DarkForest_1.json": true },
{ "DarkForest_2.json": false },


Expand Down
6 changes: 6 additions & 0 deletions osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Only Used For Developer And Debuger

# just call another DEBUG shell:
./unix_debug.sh
7 changes: 4 additions & 3 deletions shaders/unifiedColor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ void main()
discard;
}

vec3 outColor3 = change_color( texColor.rgb );
// 已经不需要这份计算了
//vec3 outColor3 = change_color( texColor.rgb );

//FragColor = texColor;
FragColor = vec4( outColor3.rgb, texColor.a );
FragColor = texColor;
//FragColor = vec4( outColor3.rgb, texColor.a );
}


Expand Down
64 changes: 59 additions & 5 deletions shaders/waterAnimCanvas.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,35 @@ float seaLvl; //- 海平面。 值越小,land区越大。通过平滑曲线


//--- sec visual style ----
/*
vec3 color_sea_2 = vec3( 0.745, 0.753, 0.706 );
vec3 color_sea_3 = vec3( 0.608, 0.627, 0.596 );
vec3 color_sea_4 = vec3( 0.521, 0.541, 0.525 );
vec3 color_sea_5 = vec3( 0.423, 0.443, 0.435 );
*/

/*
vec3 color_sea_2 = vec3( 197.0/255.0, 176.0/255.0, 126.0/255.0 );
vec3 color_sea_3 = vec3( 180.0/255.0, 155.0/255.0, 112.0/255.0 );
vec3 color_sea_4 = color_sea_3;
vec3 color_sea_5 = color_sea_3;
*/


//vec3 color_sea_2 = vec3( 92.0/255.0, 91.0/255.0, 84.0/255.0 ); // 深色
//vec3 color_sea_3 = vec3( 253.0/255.0, 247.0/255.0, 209.0/255.0 ); // 最浅色

vec3 color_sea_2 = vec3( 253.0/255.0, 247.0/255.0, 209.0/255.0 ); // 最浅色

//vec3 color_sea_2 = vec3( 214.0/255.0, 190.0/255.0, 134.0/255.0 ); // 中黄色
vec3 color_sea_3 = vec3( 214.0/255.0, 190.0/255.0, 134.0/255.0 ); // 中黄色
vec3 color_sea_4 = color_sea_3;
vec3 color_sea_5 = color_sea_3;






// 在未来,将被 UnifiedColorTable 取代 ....

Expand All @@ -113,13 +138,14 @@ vec2 calc_outFPos( vec2 innFPos_ );
*/
void main()
{
//discard;
discard;
prepare();

//------------------//
// time
//------------------//
float tm = tprTime.currentTime * 0.08;
//float tm = 123456.34 * 0.08; // 固定值
//- 理想的 time 值是一个 在 [0.0, n.0] 之间来回运动的值。
// 目前仅仅是一个不断变大的值

Expand All @@ -129,10 +155,14 @@ void main()
// 如果去掉这组代码,canvas将永远是 最细腻的
vec2 pixCFPos = camera.canvasCFPos + lbAlign;


//- chunk 内 晶格 数量
// 1-pix 一个 cell
float cellDensity = PIXES_PER_CHUNK;

pixCFPos *= PIXES_PER_CHUNK; //- 晶格边长
pixCFPos *= cellDensity; //- 晶格边长
pixCFPos = floor(pixCFPos);
pixCFPos = pixCFPos / PIXES_PER_CHUNK;
pixCFPos = pixCFPos / cellDensity;

//--------- 坐标系转换 ---------//
// 变成 轴测图 坐标系
Expand All @@ -152,6 +182,9 @@ void main()
// 暂时不改写 seaLvl 值,这样,无论走多远,世界的 水陆分布还是原来的比例
// 如果开启这个设置,玩家向四周探索时,世界中的水域会变多,直到没有陆地

//-------------
// 强制性的,人为缩小水域面积。
seaLvl += -40.0; // [0.0, 100.0]

if( seaLvl < 0.0 ){ //- land
seaLvl *= 0.3; // [-15.0, 100.0]
Expand All @@ -173,6 +206,7 @@ void main()

//-- -未叠加动态值 之前的 land区域,被挖空 ---
altiVal = floor(pnValBig + pnValMid + pnValSml);

if( altiVal > 0.0 ){
discard;
}
Expand All @@ -195,8 +229,26 @@ void main()
// lvl
//------------------//
float altiLvl;
if( altiVal < 0.0 ){ //- under water

if( altiVal < -0.0 ){ //- under water

// 尝试降低水面高度,

if( altiVal > -30.0 ){
altiLvl = -3.0; // 暂时用 相同的 颜色
}else{
altiLvl = -3.0;
}


}else{ //- land
//altiLvl = 1.0;
discard;
}


/*
if( altiVal < 0.0 ){ //- under water
//------ -2 -------
if( altiVal > -30.0 ){
altiLvl = -2.0;
Expand All @@ -220,6 +272,7 @@ void main()
}else{ //- land
altiLvl = 1.0;
}
*/

//------------------//
// color
Expand All @@ -243,7 +296,8 @@ void main()

//discard;

FragColor = vec4( color, alpha );
FragColor = vec4( color, 1.0 );
//FragColor = vec4( color, alpha );
//FragColor = vec4( 0.5, 0.3, 0.2, 0.2 );
//FragColor = vec4( 0.1, 0.1, 0.1, 0.0 );
//FragColor = vec4( color, alpha ); //- rgba.alpha MUST be 1.0 !!!
Expand Down
Loading

0 comments on commit 1585f5d

Please sign in to comment.