Skip to content

Commit

Permalink
Merge pull request #118 from cerberusxdev/develop
Browse files Browse the repository at this point in the history
v2022-03-26
  • Loading branch information
MikeHart66 authored Mar 26, 2022
2 parents 1c5eedc + 817c4f5 commit 6d810ad
Show file tree
Hide file tree
Showing 27 changed files with 687 additions and 2,143 deletions.
26 changes: 19 additions & 7 deletions VERSIONS.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
***** v2022-03-26 *****

FIX: [TRANS] Adding content to Preprocessors vars used the wrong delimiter. (Author: Phil7)
FIX: [CSERVER] Fixed xml mime type. (Author: MikeHart)
MOD: [TRANSCC] Depreciated AGK Targets. They will become cutsom targets at one point. (Author: MikeHart)
MOD: [TRANSCC] Depreciated the following depreciated builders. PSM, XNA, FLASH, ANDROID_NDK, WINRT. (Author: MikeHart)
MOD: [BRL.XML] Added Method GetElements:List<XmlElement>() to retrieve all root elements. (Author: MikeHart)
MOD: [example] Modified the brl.ReadXml example to show how to parse a XML struture. (Author: MikeHart)
MOD: [CERBERUSX] REMOVED #MOJO_USE_MONKEYSTATE=false Flag due to legal reasons. (Author: MikeHart)


KNOWN ISSUES:
- Window dragging in 32 bit Release mode still crashes, need to figure out why that is.
- GLFW_APP_ICON doesn't work with OSX and Linux.
- Because of changes in the Google billing SDK, new apps using brl.cerberusstore in Android can not be submitted atm.
- Because of changes in the Google admob SDK, new apps using brl.admob in iOS can not be submitted atm.


***** v2022-03-06 *****

FIX: [docs] Added missing entries to the examples pages. (Author: MikeHart)
Expand Down Expand Up @@ -33,13 +51,7 @@ NEW: [brl.xml] Added a XML module. (Author: MikeHart)
NEW: [brl.vec2d] Added a 2d vector module. (Author: MikeHart)
NEW: [mojo2] Added DrawList.DrawRoundedRect:Void(x:Float, y:Float, width:Float, height:Float, radius:Float=10, material:Material=Null). (Author: MikeHart)
NEW: [brl.events] Added an event handling module. (Author: MikeHart)
NEW: [mojo] Added #MOJO_USE_MONKEYSTATE=False to be able to switch to use old monkeystate.


KNOWN ISSUES:
- Window dragging in 32 bit Release mode still crashes, need to figure out why that is.
- GLFW_APP_ICON doesn't work with OSX and Linux.
- Because of changes in the Google billing SDK, new apps using brl.cerberusstore in Android can not be submitted atm.
NEW: [mojo] Added #MOJO_USE_MONKEYSTATE=False to be able to switch to use old monkeystate.


***** v2021-05-16 *****
Expand Down
2 changes: 0 additions & 2 deletions docs/cerberusdoc/Programming/App config settings.cerberusdoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ The following app config settings are currently supported:

'Mojo settings, defaults shown
'
#MOJO_USE_MONKEYSTATE=False 'Set to True to use monkeystate instead of cerberusstate
'to save app data
#MOJO_AUTO_SUSPEND_ENABLED=True 'Set to True to cause app to suspend when desktop window loses focus.
#MOJO_HICOLOR_TEXTURES=True
#MOJO_IMAGE_FILTERING_ENABLED=True
Expand Down
33 changes: 32 additions & 1 deletion examples/brl/xml/ReadXml.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ Import os
Function Main:Int()
Print ("Cerberus X - ReadXml Test~n")
Local xml := New Xml(LoadString("data/data.xml"))
Print xml.ToString()
'Print xml.ToString()

Local elements:= xml.GetElements()

For Local element := Eachin elements
ParseElement (element)
Next

Return 0
End

Function ParseElement:Void(element:XmlElement)
Print "Element "+element.Name + " Content ="+element.Content

ParseAttributes(element)

Local childElements := element.GetElements()
If childElements
For Local childElement := Eachin childElements
ParseElement(childElement)
Next
Endif
End

Function ParseAttributes:Void(element:XmlElement)
Local attributes := element.GetAttributes()
If attributes
For Local attrib := Eachin attributes
Print " attrib "+attrib.Key+ "="+attrib.Value
Next
Endif
End


35 changes: 34 additions & 1 deletion modules/brl/cerberusdoc/xml.cerberusdoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,38 @@ Import os
Function Main:Int()
Print ("Cerberus X - ReadXml Test~n")
Local xml := New Xml(LoadString("data/data.xml"))
Print xml.ToString()
'Print xml.ToString()

Local elements:= xml.GetElements()

For Local element := Eachin elements
ParseElement (element)
Next

Return 0
End

Function ParseElement:Void(element:XmlElement)
Print "Element "+element.Name + " Content ="+element.Content

ParseAttributes(element)

Local childElements := element.GetElements()
If childElements
For Local childElement := Eachin childElements
ParseElement(childElement)
Next
Endif
End

Function ParseAttributes:Void(element:XmlElement)
Local attributes := element.GetAttributes()
If attributes
For Local attrib := Eachin attributes
Print " attrib "+attrib.Key+ "="+attrib.Value
Next
Endif
End
</pre>


Expand Down Expand Up @@ -57,6 +86,10 @@ Sets the version attribute of the xml structure.

Returns the version attribute of the xml structure.

# Method GetElements:List<XmlElement>()

Returns all elements of the xml structure.


# Class brl.XmlElement

Expand Down
33 changes: 8 additions & 25 deletions modules/brl/native/gametarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,37 +188,20 @@ void BBGame::GetDate( Array<int> date ){
}

int BBGame::SaveState( String state ){
if( CFG_MOJO_USE_MONKEYSTATE ){
if( FILE *f=OpenFile( "./.monkeystate","wb" ) ){
bool ok=state.Save( f );
fclose( f );
return ok ? 0 : -2;
}
}else{
if( FILE *f=OpenFile( "./.cerberusstate","wb" ) ){
bool ok=state.Save( f );
fclose( f );
return ok ? 0 : -2;
}
if( FILE *f=OpenFile( "./.cerberusstate","wb" ) ){
bool ok=state.Save( f );
fclose( f );
return ok ? 0 : -2;
}
return -1;
}

String BBGame::LoadState(){
if( CFG_MOJO_USE_MONKEYSTATE ){
if( FILE *f=OpenFile( "./.monkeystate","rb" ) ){
String str=String::Load( f );
fclose( f );
return str;
}
}else{
if( FILE *f=OpenFile( "./.cerberusstate","rb" ) ){
String str=String::Load( f );
fclose( f );
return str;
}
if( FILE *f=OpenFile( "./.cerberusstate","rb" ) ){
String str=String::Load( f );
fclose( f );
return str;
}

return "";
}

Expand Down
12 changes: 2 additions & 10 deletions modules/brl/native/gametarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,12 @@ BBGame.prototype.GetDate=function( date ){
}

BBGame.prototype.SaveState=function( state ){
if( CFG_MOJO_USE_MONKEYSTATE=="1" ){
localStorage.setItem( "monkeystate@"+document.URL,state ); //key can't start with dot in Chrome!
}else{
localStorage.setItem( "cerberusstate@"+document.URL,state ); //key can't start with dot in Chrome!
}
localStorage.setItem( "cerberusstate@"+document.URL,state ); //key can't start with dot in Chrome!
return 1;
}

BBGame.prototype.LoadState=function(){
if( CFG_MOJO_USE_MONKEYSTATE=="1" ){
var state=localStorage.getItem( "monkeystate@"+document.URL );
}else{
var state=localStorage.getItem( "cerberusstate@"+document.URL );
}
var state=localStorage.getItem( "cerberusstate@"+document.URL );
if( state ) return state;
return "";
}
Expand Down
7 changes: 7 additions & 0 deletions modules/brl/xml.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Class Xml
Return Self._encoding
End

Method GetElements:List<XmlElement>()
If Self._elementList <> Null
Return Self._elementList
Else
Return Null
Endif
End

Private
Method _Parse:Bool(content:String)
Expand Down
3 changes: 2 additions & 1 deletion modules/trans/preprocessor.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ Function PreProcess$( path$,mdecl:ModuleDecl=Null )
If var="1" var="True" Else var="False"
Endif

If var And Not val.StartsWith( ";" ) val=";"+val
'If var And Not val.StartsWith( ";" ) val=";"+val
If var And Not val.StartsWith( "|" ) val="|"+val
SetConfigVar toke,var+val
End

Expand Down
3 changes: 2 additions & 1 deletion src/cserver/cserver.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,11 @@ Function MimeType:String( ext:String )
Case "ico","icon","icn"
Return "image/vnd.microsoft.icon"
Case "js" Return "application/javascript"
Case "xml" Return "text/xml"
Case "xml" Return "application/xml"
Case "pdf" Return "application/pdf"
Case "zip" Return "application/zip"
Case "gzip" Return "application/gzip"
Case "json" Return "application/json"
Case "cmd" Return "text/cmd"
Case "csv" Return "text/csv"
Case "css" Return "text/css"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 18 additions & 18 deletions src/transcc/builders/builders.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
Import transcc

Import android
Import android_ndk
Import flash
'Import android_ndk
'Import flash
Import glfw
Import html5
Import ios
Import psm
'Import psm
Import stdcpp
Import winrt
Import xna
Import agk
Import agk_ios
Import agk_android
Import agk_android_ouya
'Import winrt
'Import xna
'Import agk
'Import agk_ios
'Import agk_android
'Import agk_android_ouya
Import custom

Function Builders:StringMap<Builder>( tcc:TransCC )
Local builders:=New StringMap<Builder>

builders.Set "android",New AndroidBuilder( tcc )
builders.Set "android_ndk",New AndroidNdkBuilder( tcc )
'builders.Set "android_ndk",New AndroidNdkBuilder( tcc )
builders.Set "glfw",New GlfwBuilder( tcc )
builders.Set "html5",New Html5Builder( tcc )
builders.Set "ios",New IosBuilder( tcc )
builders.Set "flash",New FlashBuilder( tcc )
builders.Set "psm",New PsmBuilder( tcc )
'builders.Set "flash",New FlashBuilder( tcc )
'builders.Set "psm",New PsmBuilder( tcc )
builders.Set "stdcpp",New StdcppBuilder( tcc )
builders.Set "winrt",New WinrtBuilder( tcc )
builders.Set "xna",New XnaBuilder( tcc )
builders.Set "agk",New AGKBuilder( tcc )
builders.Set "agk_ios",New AGKBuilder_ios( tcc )
builders.Set "agk_android",New AGKBuilder_android( tcc )
builders.Set "agk_android_ouya",New AGKBuilder_android_ouya( tcc )
'builders.Set "winrt",New WinrtBuilder( tcc )
'builders.Set "xna",New XnaBuilder( tcc )
'builders.Set "agk",New AGKBuilder( tcc )
'builders.Set "agk_ios",New AGKBuilder_ios( tcc )
'builders.Set "agk_android",New AGKBuilder_android( tcc )
'builders.Set "agk_android_ouya",New AGKBuilder_android_ouya( tcc )
builders.Set "custom",New CustomBuilder( tcc )

Return builders
Expand Down
Loading

0 comments on commit 6d810ad

Please sign in to comment.